code: def _ExtractCounterfactualPredictions(  # pylint: disable=invalid-name
      extracts: beam.PCollection[types.Extracts],
      config: CounterfactualConfig,
      predictions_ptransform: beam.PTransform,
  ) -> beam.PCollection[types.Extracts]:
      """Computes counterfactual predictions for a single model."""
      return (
          extracts
          | "PreprocessInputs"
          >> beam.Map(_cf_preprocess, config=config)
          | "Predict" >> predictions_ptransform
          | "PostProcessPredictions" >> beam.Map(_cf_postprocess)
      )
  
file_path: model-analysis/tensorflow_model_analysis/extractors/counterfactual_predictions_extractor.py
imports: from typing import Dict, Iterable, Mapping, Optional
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.extractors import predictions_extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
label_desc: Use image node_id 6 for calling a global function with example usage: _ExtractCounterfactualPredictions(extracts, config, predictions_ptransform) and returns: unknown