code: def _get_opt_einsum_contract_path(
      equation, shaped_inputs_tuple, optimize
  ):
      """Returns the (memoized) result of opt_einsum.contract_path."""
      # Note: We use einsum_call=True, which is an internal api for opt_einsum,
      # to get the contraction path without having opt_einsum perform the actual
      # contractions.
      _, contractions = opt_einsum.contract_path(
          equation,
          *shaped_inputs_tuple,
          optimize=optimize,
          einsum_call=True,
          use_blas=True,
      )
      # Return a tuple so that the cached value is not mutable.
      indices_and_equations = tuple(
          [(expr[0], expr[2]) for expr in contractions]
      )
      return indices_and_equations
  
imports: import collections
  import functools
  import re
  import string
  import numpy
  import opt_einsum
  from tensorflow.compiler.tf2xla.ops import gen_xla_ops
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gen_linalg_ops
  from tensorflow.python.ops import gen_special_math_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 31 for calling a global function with example usage: _get_opt_einsum_contract_path(equation, shaped_inputs_tuple, optimize) and returns: indices_and_equations