code: def replace_composites_with_components(structure):
      """Recursively replaces CompositeTensors with their components.
  
      Args:
        structure: A `nest`-compatible structure, possibly containing composite
          tensors.
  
      Returns:
        A copy of `structure`, where each composite tensor has been replaced by
        its components.  The result will contain no composite tensors.
        Note that `nest.flatten(replace_composites_with_components(structure))`
        returns the same value as `nest.flatten(structure)`.
      """
      if isinstance(structure, CompositeTensor):
          return replace_composites_with_components(
              structure._type_spec._to_components(structure)
          )  # pylint: disable=protected-access
      elif not nest.is_nested(structure):
          return structure
      else:
          return nest.map_structure(
              replace_composites_with_components,
              structure,
              expand_composites=False,
          )
  
file_path: tensorflow-upstream/tensorflow/python/framework/composite_tensor.py
imports: import abc
  from tensorflow.python import pywrap_tensorflow
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 for calling a global function with example usage: replace_composites_with_components(structure) and returns: replace_composites_with_components, structure, nest