#NEWLINE# def flatten_childtrees( trees ) : #NEWLINE# #INDENT# children = [ ] #NEWLINE# for t in trees : #NEWLINE# #INDENT# if ( t . height ( ) < 3 ) : #NEWLINE# #INDENT# children . extend ( t . pos ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( t . height ( ) == 3 ) : #NEWLINE# #INDENT# children . append ( Tree ( node_label ( t ) , t . pos ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# children . extend ( flatten_childtrees ( [ c for c in t ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return children