code: def get_node_wrapped_tensor_info(
      meta_graph_def: meta_graph_pb2.MetaGraphDef, path: str
  ) -> any_pb2.Any:
      """Get the Any-wrapped TensorInfo for the node from the meta_graph_def.
  
      Args:
         meta_graph_def: MetaGraphDef containing the CollectionDefs to extract the
           node name from.
         path: Name of the collection containing the node name.
  
      Returns:
        The Any-wrapped TensorInfo for the node retrieved from the CollectionDef.
  
      Raises:
        KeyError: There was no CollectionDef with the given name (path).
        ValueError: The any_list in the CollectionDef with the given name did
          not have length 1.
      """
      if path not in meta_graph_def.collection_def:
          raise KeyError(
              "could not find path %s in collection defs. meta_graph_def "
              "was %s" % (path, meta_graph_def)
          )
      if len(meta_graph_def.collection_def[path].any_list.value) != 1:
          raise ValueError(
              "any_list should be of length 1. path was %s, any_list was: %s."
              % (
                  path,
                  meta_graph_def.collection_def[path].any_list.value,
              )
          )
      return meta_graph_def.collection_def[path].any_list.value[0]
  
imports: import collections
  from typing import Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import util
  from google.protobuf import any_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
label_desc: Use image node_id 12 for calling a global function with example usage: get_node_wrapped_tensor_info(meta_graph_def, path) and returns: meta_graph_def