code: def _make_composite_tensor_wrapper_if_composite(
      x: common_types.ConsistentTensorType,
  ) -> Callable[[tf.Tensor], common_types.ConsistentTensorType]:
      """Produces a function to wrap values in the composite structure of x."""
      if isinstance(x, tf.SparseTensor):
          return lambda values: tf.SparseTensor(
              x.indices, values, x.dense_shape
          )
      elif isinstance(x, tf.RaggedTensor):
  
          def from_nested_row_splits(values):
              return tf.RaggedTensor.from_nested_row_splits(
                  values, x.nested_row_splits, validate=False
              )
  
          return from_nested_row_splits
      else:
          return lambda values: values
  
imports: import os
  from typing import Any, Callable, Iterable, Optional, Tuple, Union
  import tensorflow
  from tensorflow_transform import analyzers
  from tensorflow_transform import common
  from tensorflow_transform import common_types
  from tensorflow_transform import gaussianization
  from tensorflow_transform import schema_inference
  from tensorflow_transform import tf_utils
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 32 for calling a global function with example usage: _make_composite_tensor_wrapper_if_composite(x) and returns: function, from_nested_row_splits, function, tf