class_docstr: Generate random syntactically-valid Python ASTs.
docstr: Generate a statement node, dispatching to the correct class method.
docstr_tok: ["Generate","a","statement","node",",","dispatching","to","the","correct","class","method","."]
code: def generate_statement(self):
      """Generate a statement node, dispatching to the correct class method."""
      desired_node = StatementSampler().sample()
      self.depth += 1
  
      # Enforce some constraints on generating statements.
      # E.g., if statements need at least 3 readable variables.
      # If we fail to satisfy our constraints, draw another sample.
      if desired_node in (gast.While, gast.For, gast.If):
          if self.depth > self.max_depth:
              return self.generate_statement()
  
      # Go get the generator method and run it
      method = "generate_" + desired_node.__name__
      visitor = getattr(self, method)
      node = visitor()
      self.depth -= 1
      return node
  
imports: import random
  import string
  import gast
  import numpy
  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.generate_statement() and returns: node, self