B
    ,[                 @   s6   d dl mZmZ dddgZdd Zdd Zdd ZdS )	    )assert_equal	assert_inassert_nodes_equalassert_edges_equalassert_graphs_equalc          	   C   s`   t | }t |}yt|}t|}W n, ttfk
rP   t|}t|}Y nX t|| d S )N)listdict
ValueError	TypeErrorfromkeysr   )Znodes1Znodes2Znlist1Znlist2d1d2 r   5lib/python3.7/site-packages/networkx/testing/utils.pyr      s    
c             C   s  ddl m} |t}|t}d}xht| D ]\\}}|d |d  }}|dd  g}	||| krn|| | |	 }	|	|| |< |	|| |< q*W d}
xht|D ]\\}
}|d |d  }}|dd  g}	||| kr|| | |	 }	|	|| |< |	|| |< qW t||
 xx| D ]l\}}x`| D ]T\}}t|| t|||  || | }x$|D ]}	t||	||	 qPW qW qW d S )Nr   )defaultdict      )collectionsr   r   	enumerater   itemsr   count)Zedges1Zedges2r   r   r   Zc1euvdataZc2nZnbrdictZnbrZdatalistZ
d2datalistr   r   r   r      s6    


c             C   s.   t | j|j t | j|j t | j|j d S )N)r   ZadjZnodesZgraph)Zgraph1Zgraph2r   r   r   r   6   s    N)Z
nose.toolsr   r   __all__r   r   r   r   r   r   r   <module>   s   
#