#NEWLINE# def print_tree( self , level = 0 , max_depth = None ) : #NEWLINE# #INDENT# print ( ( ( '  ' * level ) + str ( self ) ) ) #NEWLINE# if ( ( max_depth is not None ) and ( max_depth <= level ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# for child in self . children ( ) : #NEWLINE# #INDENT# child . print_tree ( ( level + 1 ) , max_depth = max_depth )