#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# 'Prep the self' #NEWLINE# self . simple_t = TreeNode . read ( io . StringIO ( '((a,b)i1,(c,d)i2)root;' ) ) #NEWLINE# nodes = dict ( [ ( x , TreeNode ( x ) ) for x in 'abcdefgh' ] ) #NEWLINE# nodes [ 'a' ] . append ( nodes [ 'b' ] ) #NEWLINE# nodes [ 'b' ] . append ( nodes [ 'c' ] ) #NEWLINE# nodes [ 'c' ] . append ( nodes [ 'd' ] ) #NEWLINE# nodes [ 'c' ] . append ( nodes [ 'e' ] ) #NEWLINE# nodes [ 'c' ] . append ( nodes [ 'f' ] ) #NEWLINE# nodes [ 'f' ] . append ( nodes [ 'g' ] ) #NEWLINE# nodes [ 'a' ] . append ( nodes [ 'h' ] ) #NEWLINE# self . TreeNode = nodes #NEWLINE# self . TreeRoot = nodes [ 'a' ] #NEWLINE# def rev_f( items ) : #NEWLINE# #INDENT# items . reverse ( ) #NEWLINE# #UNINDENT# def rotate_f( items ) : #NEWLINE# #INDENT# tmp = items [ ( - 1 ) ] #NEWLINE# items [ 1 : ] = items [ : ( - 1 ) ] #NEWLINE# items [ 0 ] = tmp #NEWLINE# #UNINDENT# self . rev_f = rev_f #NEWLINE# self . rotate_f = rotate_f #NEWLINE# self . complex_tree = TreeNode . read ( io . StringIO ( '(((a,b)int1,(x,y,(w,z)int2,(c,d)int3)int4),(e,f)int5);' ) )