code: def outside_or_skip_tpu_context():
      """Returns a context manager that skips current enclosing context if there is any."""
      ctx, graph = enclosing_tpu_context_and_graph()
      if ctx is None:
          yield
      else:
          saved_context = (
              graph._get_control_flow_context()
          )  # pylint: disable=protected-access
          graph._set_control_flow_context(
              ctx.outer_context
          )  # pylint: disable=protected-access
          yield
          graph._set_control_flow_context(saved_context)
  
imports: import contextlib
  from tensorflow.python.distribute import packed_distributed_variable
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.tpu import tpu_replication
label_desc: Use image node_id 3 for calling a global function with example usage: outside_or_skip_tpu_context() without return types