#NEWLINE# def add_row( self , data , parent = None ) : #NEWLINE# #INDENT# node = TreeNode ( data , [ ] ) #NEWLINE# if ( parent is None ) : #NEWLINE# #INDENT# self . rows . append ( data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# parent . children . append ( node ) #NEWLINE# #UNINDENT# return node