#NEWLINE# def test_multiedge( ) : #NEWLINE# #INDENT# edges = [ ( 0 , 1 ) , ( 1 , 2 ) , ( 2 , 3 ) , ( 3 , 4 ) , ( 4 , 5 ) , ( 5 , 6 ) , ( 6 , 7 ) , ( 7 , 8 ) , ( 8 , 9 ) , ( 9 , 10 ) , ( 10 , 11 ) , ( 10 , 11 ) , ( 11 , 12 ) , ( 11 , 12 ) , ( 12 , 13 ) , ( 12 , 13 ) , ( 13 , 14 ) , ( 13 , 14 ) , ( 14 , 15 ) , ( 14 , 15 ) , ( 15 , 16 ) , ( 15 , 16 ) , ( 16 , 17 ) , ( 16 , 17 ) , ( 17 , 18 ) , ( 17 , 18 ) , ( 18 , 19 ) , ( 18 , 19 ) , ( 19 , 0 ) , ( 19 , 0 ) ] #NEWLINE# nodes = list ( range ( 20 ) ) #NEWLINE# for g1 in [ nx . MultiGraph ( ) , nx . MultiDiGraph ( ) ] : #NEWLINE# #INDENT# g1 . add_edges_from ( g2 ) #NEWLINE# for _ in range ( 10 ) : #NEWLINE# #INDENT# new_nodes = list ( nodes ) #NEWLINE# random . shuffle ( new_nodes ) #NEWLINE# d = dict ( zip ( nodes , new_nodes ) ) #NEWLINE# g2 = nx . relabel_nodes ( g1 , d ) #NEWLINE# if ( not g1 . is_directed ( ) ) : #NEWLINE# #INDENT# gm = iso . GraphMatcher ( g1 , g2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# gm = iso . DiGraphMatcher ( g1 , g2 ) #NEWLINE# #UNINDENT# assert_true ( gm . is_isomorphic ( ) )