code: def _get_component_tensors(
      tensor: Union[tf.Tensor, composite_tensor.CompositeTensor]
  ) -> Iterable[tf.Tensor]:
      """Get all component tensors.
  
      Args:
        tensor: A `Tensor` or `CompositeTensor`.
  
      Returns:
        All `Tensor` components of `tensor`.
  
      Raises:
        ValueError if supplied `tensor` parameter is neither a `Tensor` nor a
        `CompositeTensor`.
      """
      if isinstance(tensor, tf.Tensor):
          return [tensor]
      elif isinstance(tensor, composite_tensor.CompositeTensor):
          return tf.nest.flatten(tensor, expand_composites=True)
      else:
          raise ValueError(
              "Unsupported tensor. Arg `tensor` is neither a `Tensor` nor a "
              f"`CompositeTensor`: {tensor}."
          )
  
imports: from typing import Any, Dict, Iterable, Mapping, Tuple, Union
  import tensorflow
  from tensorflow_transform import annotators
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_tools
  from tensorflow_transform import tf2_utils
  from tensorflow_transform import tf_utils
  from tensorflow_transform.py_func import pyfunc_helper
  from tensorflow_transform.saved import constants
  from tensorflow_transform.saved import saved_model_loader
  from tensorflow_transform.saved import saved_transform_io
  from tensorflow.python.eager import function
  from tensorflow.python.eager import wrap_function
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 3 for calling a global function with example usage: _get_component_tensors(tensor) and returns: list, tf