#NEWLINE# def assert_nodes_equal( nodes1 , nodes2 ) : #NEWLINE# #INDENT# nlist1 = list ( nodes1 ) #NEWLINE# nlist2 = list ( nodes2 ) #NEWLINE# try : #NEWLINE# #INDENT# d1 = dict ( nlist1 ) #NEWLINE# d2 = dict ( nlist2 ) #NEWLINE# #UNINDENT# except ( ValueError , TypeError ) : #NEWLINE# #INDENT# d1 = dict . fromkeys ( nlist1 ) #NEWLINE# d2 = dict . fromkeys ( nlist2 ) #NEWLINE# #UNINDENT# assert_equal ( d1 , d2 )