def to_source(node, indent_with=(' ' * 4)):
 generator = SourceGenerator(indent_with)
 generator.visit(node)
 return ''.join(generator.result)

def to_source ( node , indent_with = ( ' ' * 4 ) ) : generator = SourceGenerator ( indent_with ) generator . visit ( node ) return '' . join ( generator . result )
this function can convert a node tree back into python sourcecode .