code: def get_tensors_from_tensor_names(graph, tensor_names):
      """Gets the Tensors associated with the `tensor_names` in the provided graph.
  
      Args:
        graph: TensorFlow Graph.
        tensor_names: List of strings that represent names of tensors in the graph.
  
      Returns:
        A list of Tensor objects in the same order the names are provided.
  
      Raises:
        ValueError:
          tensor_names contains an invalid tensor name.
      """
      # Get the list of all of the tensors.
      tensor_name_to_tensor = {}
      for op in graph.get_operations():
          for tensor in op.values():
              tensor_name_to_tensor[get_tensor_name(tensor)] = tensor
  
      # Get the tensors associated with tensor_names.
      tensors = []
      invalid_tensors = []
      for name in tensor_names:
          if not isinstance(name, str):
              raise ValueError(
                  "Invalid type for a tensor name in the provided graph. "
                  "Expected type for a tensor name is 'str', instead got "
                  "type '{}' for tensor name '{}'".format(
                      type(name), name
                  )
              )
  
          tensor = tensor_name_to_tensor.get(name)
          if tensor is None:
              invalid_tensors.append(name)
          else:
              tensors.append(tensor)
  
      # Throw ValueError if any user input names are not valid tensors.
      if invalid_tensors:
          raise ValueError(
              "Invalid tensors '{}' were found.".format(
                  ",".join(invalid_tensors)
              )
          )
      return tensors
  
imports: import copy
  import datetime
  import sys
  from absl import logging
  import flatbuffers
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.lite.python import conversion_metadata_schema_py_generated
  from tensorflow.lite.python import schema_py_generated
  from tensorflow.lite.python import schema_util
  from tensorflow.lite.python import tflite_keras_util
  from tensorflow.lite.python.op_hint import convert_op_hints_to_stubs
  from tensorflow.lite.python.op_hint import find_all_hinted_output_nodes
  from tensorflow.lite.tools import flatbuffer_utils
  from tensorflow.python.eager import function
  from tensorflow.python.framework import convert_to_constants
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import error_interpolation
  from tensorflow.python.grappler import tf_optimizer
  from tensorflow.python.training.saver import export_meta_graph
label_desc: Use image node_id 4 for calling a global function with example usage: get_tensors_from_tensor_names(graph, tensor_names) and returns: tensors