code: def _ExtractTransformedFeatures(  # pylint: disable=invalid-name
      extracts: beam.pvalue.PCollection,
      eval_config: config_pb2.EvalConfig,
      eval_shared_models: Dict[str, types.EvalSharedModel],
  ) -> beam.pvalue.PCollection:
      """A PTransform that updates extracts to include transformed features.
  
      Args:
        extracts: PCollection of extracts containing raw inputs keyed by
          tfma.FEATURES_KEY (if preprocessing function inputs are named) or
          tfma.INPUTS_KEY (if preprocessing functions take raw tf.Examples as input)
        eval_config: Eval config.
        eval_shared_models: Shared model parameters keyed by model name.
  
      Returns:
        PCollection of Extracts updated with the to include transformed features
        stored under the key tfma.TRANSFORMED_FEATURES_KEY.
      """
      signature_names = {}
      for spec in eval_config.model_specs:
          model_name = (
              "" if len(eval_config.model_specs) == 1 else spec.name
          )
          signature_names[model_name] = list(
              spec.preprocessing_function_names
          )
  
      return extracts | "Predict" >> beam.ParDo(
          model_util.ModelSignaturesDoFn(
              model_specs=eval_config.model_specs,
              eval_shared_models=eval_shared_models,
              output_keypath=(constants.TRANSFORMED_FEATURES_KEY,),
              signature_names=signature_names,
              default_signature_names=list(_DEFAULT_SIGNATURE_NAMES),
              prefer_dict_outputs=True,
          )
      )
  
file_path: model-analysis/tensorflow_model_analysis/extractors/transformed_features_extractor.py
imports: from typing import Dict
  import apache_beam
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
label_desc: Use image node_id 2 for calling a global function with example usage: _ExtractTransformedFeatures(extracts, eval_config, eval_shared_models) and returns: unknown