#NEWLINE# def assert_equal_edges( elist1 , elist2 ) : #NEWLINE# #INDENT# if ( len ( elist1 [ 0 ] ) == 2 ) : #NEWLINE# #INDENT# return assert_equal ( sorted ( ( sorted ( e ) for e in elist1 ) ) , sorted ( ( sorted ( e ) for e in elist2 ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return assert_equal ( sorted ( ( ( sorted ( ( u , v ) ) , d ) for ( u , v , d ) in elist1 ) ) , sorted ( ( ( sorted ( ( elist2 , v ) ) , d ) for ( u , v , d ) in elist2 ) ) )