code: def _get_outer_most_capture(
      original_graph: func_graph_module.FuncGraph, capture: _TensorType
  ) -> tuple[func_graph_module.FuncGraph, _TensorType]:
      """Tries to find the original captured tensor."""
      outer_graph = original_graph
      while outer_graph is not None and not isinstance(
          capture, ops.EagerTensor
      ):
          if capture.graph is not outer_graph:
              outer_graph = outer_graph.outer_graph
          else:
              try:
                  capture_index = outer_graph.internal_captures.index(
                      capture
                  )
              except ValueError:
                  # Capture is a tensor inside the function and is not captured from
                  # another external function
                  break
              capture = outer_graph.external_captures[capture_index]
              outer_graph = outer_graph.outer_graph
  
      return outer_graph, capture
  
imports: from typing import Any, Callable, Iterator, Optional, Union
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.core.framework import function_pb2
  from tensorflow.core.function.capture import restore_captures
  from tensorflow.core.function.runtime_client import runtime_client
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import function
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import function_def_to_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import custom_gradient
  from tensorflow.python.ops import default_gradient
  from tensorflow.python.ops import handle_data_util
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
label_desc: Use image node_id 5 for calling a global function with example usage: _get_outer_most_capture(original_graph, capture) and returns: outer_graph,  capture