class_docstr: Base class for general-purpose Python-to-string code transformation.
  
  Similar to Base, but outputs arbitrary strings instead of a Python AST.
  
  This uses the same visitor mechanism that the standard NodeVisitor uses,
  meaning that subclasses write handlers for the different kinds of nodes.
  New code is generated using the emit method, which appends to a code buffer
  that can be afterwards obtained from code_buffer.
  
  Example:
  
    class SimpleCodeGen(CodeGenerator):
  
      def visitIf(self, node):
        self.emit('if ')
        self.visit(node.test)
        self.emit(' { ')
        self.visit(node.body)
        self.emit(' } else { ')
        self.visit(node.orelse)
        self.emit(' } ')
  
    node = ast.parse(...)
    gen = SimpleCodeGen()
    gen.visit(node)
    # gen.code_buffer contains the resulting code
class_docstr_tok: ["Base","class","for","general-purpose","Python-to-string","code","transformation",".","Similar","to","Base",",","but","outputs","arbitrary","strings","instead","of","a","Python","AST",".","This","uses","the","same","visitor","mechanism","that","the","standard","NodeVisitor","uses",",","meaning","that","subclasses","write","handlers","for","the","different","kinds","of","nodes",".","New","code","is","generated","using","the","emit","method",",","which","appends","to","a","code","buffer","that","can","be","afterwards","obtained","from","code_buffer",".","Example",":","class","SimpleCodeGen","(","CodeGenerator",")",":","def","visitIf","(","self",",","node",")",":","self.emit","(","'if","'",")","self.visit","(","node.test",")","self.emit","(","'","{","'",")","self.visit","(","node.body",")","self.emit","(","'","}","else","{","'",")","self.visit","(","node.orelse",")","self.emit","(","'","}","'",")","node","=","ast.parse","(","...",")","gen","=","SimpleCodeGen","(",")","gen.visit","(","node",")","#","gen.code_buffer","contains","the","resulting","code"]
code: def emit(self, code):
      self._output_code += code
  
imports: import collections
  import enum
  import gast
  from tensorflow.python.autograph.pyct import anno
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import pretty_printer
  from tensorflow.python.autograph.pyct import templates
label_desc: Use image node_id 2 for calling the CodeGenerator obj's underlying member method code with example usage: obj.emit(code) without return types