code: def get_func_graph_for_name(graph, func_name):
      """Returns the FuncGraph associated to the given func_name if possible."""
      outer_graph = graph
      while graph is not None:
          func = graph._get_function(
              str(func_name)
          )  # pylint: disable=protected-access
          if func is not None:
              if hasattr(func, "graph"):
                  return func.graph
              # `outer_graph` may not be the same as `ops.get_default_graph()` e.g.
              # in the case of nested if ops or when the gradient is being computed
              # from inside a Defun. We build the `func_graph` with `outer_graph` as its
              # outer graph.
              with outer_graph.as_default():
                  # This is a _DefinedFunction.
                  func_graph = (
                      function_def_to_graph.function_def_to_graph(
                          func.definition
                      )
                  )
              if func_graph is not None:
                  return func_graph
          if hasattr(graph, "outer_graph"):
              graph = graph.outer_graph
          else:
              raise ValueError(
                  "Function {} does not exist in the graph.".format(
                      func_name
                  )
              )
  
imports: import collections
  import copy
  import hashlib
  import itertools
  from typing import Iterable, List, Mapping, Optional, Set, Union
  import uuid
  from absl import logging
  import tensorflow
  from tensorflow_transform import analyzer_nodes
  from tensorflow_transform import common_types
  from tensorflow_transform import nodes
  from tensorflow_transform import tf_utils
  from tfx_bsl.types import tfx_namedtuple
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import function_def_to_graph
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 3 for calling a global function with example usage: get_func_graph_for_name(graph, func_name) and returns: func, func_graph