code: def _trace_and_write_transform_fn(
      saved_model_dir: str,
      preprocessing_fn: Callable[
          [Mapping[str, common_types.TensorType]],
          Mapping[str, common_types.TensorType],
      ],
      input_signature: Mapping[str, tf.TypeSpec],
      base_temp_dir: Optional[str],
      tensor_replacement_map: Optional[Dict[str, tf.Tensor]],
      output_keys_to_name_map: Optional[Dict[str, str]],
  ) -> function.ConcreteFunction:
      """Trace `preprocessing_fn` and serialize to a SavedModel."""
      tf_graph_context = graph_context.TFGraphContext(
          module_to_export=tf.Module(),
          temp_dir=base_temp_dir,
          evaluated_replacements=tensor_replacement_map,
      )
      transform_fn = get_traced_transform_fn(
          preprocessing_fn,
          input_signature,
          tf_graph_context,
          output_keys_to_name_map=output_keys_to_name_map,
      )
      return saved_transform_io_v2.write_v2_saved_model(
          tf_graph_context.module_to_export,
          transform_fn,
          "transform_fn",
          saved_model_dir,
      )
  
imports: import functools
  import os
  import re
  from typing import Callable, Dict, List, Mapping, Optional, FrozenSet
  from absl import logging
  import numpy
  import pyarrow
  import tensorflow
  from tensorflow_transform import analyzer_nodes
  from tensorflow_transform import annotators
  from tensorflow_transform import common_types
  from tensorflow_transform import graph_context
  from tensorflow_transform import graph_tools
  from tensorflow_transform import schema_inference
  from tensorflow_transform import tf2_utils
  from tensorflow_transform import tf_utils
  from tensorflow_transform.output_wrapper import TFTransformOutput
  from tensorflow_transform.saved import saved_transform_io
  from tensorflow_transform.saved import saved_transform_io_v2
  from tensorflow_transform.tf_metadata import dataset_metadata
  from tensorflow_transform.tf_metadata import metadata_io
  from tensorflow_transform.tf_metadata import schema_utils
  from tfx_bsl.coders import example_coder
  from tfx_bsl.tfxio import tensor_to_arrow
  from tensorflow.python.eager import function
  from tensorflow.python.framework import ops
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 15 for calling a global function with example usage: _trace_and_write_transform_fn(saved_model_dir, preprocessing_fn, input_signature, base_temp_dir, tensor_replacement_map, output_keys_to_name_map) and returns: saved_transform_io_v2