def printAst(ast, indent='  ', stream=sys.stdout, initlevel=0):
    "Pretty-print an AST to the given output stream."
    rec_node(ast, initlevel, indent, stream.write)
    stream.write('\n')
Pretty-print an AST to the given output stream.
recipes/Python/533146_AST_Pretty_Printer/recipe-533146.py