class_docstr: Rewrites a pattern where it's unobvious that all paths return a value.
  
  This rewrite allows avoiding intermediate None return values.
  
  The following pattern:
  
      if cond:
        <block 1>
        return
      else:
        <block 2>
      <block 3>
  
  is converted to:
  
      if cond:
        <block 1>
        return
      else:
        <block 2>
        <block 3>
  
  and vice-versa (if the else returns, subsequent statements are moved under the
  if branch).
class_docstr_tok: ["Rewrites","a","pattern","where","it","'s","unobvious","that","all","paths","return","a","value",".","This","rewrite","allows","avoiding","intermediate","None","return","values",".","The","following","pattern",":","if","cond",":","<","block","1",">","return","else",":","<","block","2",">","<","block","3",">","is","converted","to",":","if","cond",":","<","block","1",">","return","else",":","<","block","2",">","<","block","3",">","and","vice-versa","(","if","the","else","returns",",","subsequent","statements","are","moved","under","the","if","branch",")","."]
code: def _postprocess_statement(self, node):
      # If the node definitely returns (e.g. it's a with statement with a
      # return statement in it), then the current block also definitely returns.
      if anno.getanno(node, STMT_DEFINITELY_RETURNS, default=False):
          self.state[_RewriteBlock].definitely_returns = True
  
      # The special case: collapse a typical conditional return pattern into
      # a single conditional with possibly returns on both branches. This
      # reduces the use of None return values, which don't work with TF
      # conditionals.
      if isinstance(node, gast.If) and anno.getanno(
          node, BODY_DEFINITELY_RETURNS, default=False
      ):
          return node, node.orelse
      elif isinstance(node, gast.If) and anno.getanno(
          node, ORELSE_DEFINITELY_RETURNS, default=False
      ):
          return node, node.body
  
      return node, None
  
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 2 for calling the ConditionalReturnRewriter obj's underlying member method code with example usage: obj._postprocess_statement(node) and returns: node,  None, node,  node, node,  node