class_docstr: Lowers return statements into variables and conditionals.
  
  Specifically, the following pattern:
  
      <block 1>
      return val
      <block 2>
  
  is converted to:
  
      do_return = False
      retval = None
  
      <block 1>
  
      do_return = True
      retval = val
  
      if not do_return:
        <block 2>
  
      return retval
  
  The conversion adjusts loops as well:
  
      <block 1>
      while cond:
        <block 2>
        return retval
  
  is converted to:
  
      <block 1>
      while not do_return and cond:
        <block 2>
        do_return = True
        retval = val
class_docstr_tok: ["Lowers","return","statements","into","variables","and","conditionals",".","Specifically",",","the","following","pattern",":","<","block","1",">","return","val","<","block","2",">","is","converted","to",":","do_return","=","False","retval","=","None","<","block","1",">","do_return","=","True","retval","=","val","if","not","do_return",":","<","block","2",">","return","retval","The","conversion","adjusts","loops","as","well",":","<","block","1",">","while","cond",":","<","block","2",">","return","retval","is","converted","to",":","<","block","1",">","while","not","do_return","and","cond",":","<","block","2",">","do_return","=","True","retval","=","val"]
code: def visit_FunctionDef(self, node):
      with self.state[_Function] as fn:
          with self.state[_Block] as block:
              block.is_function = True
  
              scope = anno.getanno(node, NodeAnno.BODY_SCOPE)
              do_return_var_name = self.ctx.namer.new_symbol(
                  "do_return", scope.referenced
              )
              retval_var_name = self.ctx.namer.new_symbol(
                  "retval_", scope.referenced
              )
              fn.do_return_var_name = do_return_var_name
              fn.retval_var_name = retval_var_name
  
              node.body = self._visit_statement_block(node, node.body)
  
              if block.return_used:
                  if self.allow_missing_return:
                      # The function would have a single `with` node that wraps the
                      # entire body. If the function had a docstring, the body has two
                      # nodes, with the `with` as the second node.
                      wrapper_node = node.body[-1]
                      assert isinstance(
                          wrapper_node, gast.With
                      ), "This transformer requires the functions converter."
  
                      template = """
                do_return_var_name = False
                retval_var_name = ag__.UndefinedReturnValue()
                body
                return function_context.ret(retval_var_name, do_return_var_name)
              """
  
                      wrapper_node.body = templates.replace(
                          template,
                          body=wrapper_node.body,
                          do_return_var_name=do_return_var_name,
                          function_context=anno.getanno(
                              node, "function_context_name"
                          ),
                          retval_var_name=retval_var_name,
                      )
                  else:
                      template = """
                body
                return retval_var_name
              """
                      node.body = templates.replace(
                          template,
                          body=node.body,
                          do_return_var_name=do_return_var_name,
                          retval_var_name=retval_var_name,
                      )
  
      return node
  
imports: import gast
  from tensorflow.python.autograph.core import converter
  from tensorflow.python.autograph.pyct import anno
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import qual_names
  from tensorflow.python.autograph.pyct import templates
  from tensorflow.python.autograph.pyct.static_analysis import activity
  from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
label_desc: Use image node_id 11 for calling the ReturnStatementsTransformer obj's underlying member method code with example usage: obj.visit_FunctionDef(node) and returns: node