class_docstr: Context manager that wraps the body of a converted function.
  
  This context manager handles various operations related to the scope of a
  function:
    * optional TF name scopes - these name scopes match the name of the
        function, for easy visualization in tensorBoard;
    * optional automatic control dependencies - this adds the same mechanism
        for control dependencies that is used by `@tf.function`; it can be
        optionally enabled when using `tf.autograph.to_graph`;
    * tracking of autograph conversion state (whether it's enabled by the user,
        conversion options;
class_docstr_tok: ["Context","manager","that","wraps","the","body","of","a","converted","function",".","This","context","manager","handles","various","operations","related","to","the","scope","of","a","function",":","*","optional","TF","name","scopes","-","these","name","scopes","match","the","name","of","the","function",",","for","easy","visualization","in","tensorBoard",";","*","optional","automatic","control","dependencies","-","this","adds","the","same","mechanism","for","control","dependencies","that","is","used","by","`","@","tf.function","`",";","it","can","be","optionally","enabled","when","using","`","tf.autograph.to_graph","`",";","*","tracking","of","autograph","conversion","state","(","whether","it","'s","enabled","by","the","user",",","conversion","options",";"]
docstr: Marks a value as returned from the function guarded by the scope.
docstr_tok: ["Marks","a","value","as","returned","from","the","function","guarded","by","the","scope","."]
code: def ret(self, value, did_return):
      """Marks a value as returned from the function guarded by the scope."""
      del did_return
  
      if isinstance(value, variables.UndefinedReturnValue):
          return None
  
      if self.use_auto_deps:
          self._return_value_marked = True
          if value is None:
              # We don't create dummy returns, to preserve Python semantics. The user
              # is responsible for adding a return value to the top-level function.
              return None
  
          def _mark_return_if_tensor(t):
              if tensor_util.is_tf_type(t):
                  return self.autodeps_scope.mark_as_return(t)
              return t
  
          value = nest.map_structure(_mark_return_if_tensor, value)
      return value
  
file_path: tensorflow-upstream/tensorflow/python/autograph/core/function_wrappers.py
imports: from tensorflow.python.autograph.core import ag_ctx
  from tensorflow.python.autograph.core import converter
  from tensorflow.python.autograph.operators import variables
  from tensorflow.python.framework import auto_control_deps
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 5 for calling the FunctionScope obj's underlying member method code with example usage: obj.ret(value, did_return) and returns: value, None, None, t, self