code: def _parse_multi_inference_log(
      multi_inference_log: prediction_log_pb2.MultiInferenceLog,
      output_example_spec: _OutputExampleSpecType,
  ) -> tf.train.Example:
      """Parses MultiInferenceLog."""
      spec_map = {
          spec.signature_name
          or tf.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY: spec
          for spec in output_example_spec.output_columns_spec
      }
      example = tf.train.Example()
      example.CopyFrom(
          multi_inference_log.request.input.example_list.examples[0]
      )
      output_features = []
      for result in multi_inference_log.response.results:
          spec = spec_map[result.model_spec.signature_name]
          if result.HasField("classification_result"):
              output_features += _parse_classification_result(
                  result.classification_result, spec.classify_output
              )
          elif result.HasField("regression_result"):
              output_features.append(
                  (
                      spec.regress_output.value_column,
                      [result.regression_result.regressions[0].value],
                  )
              )
          else:
              raise ValueError(
                  "Unsupported multi_inferrence_log: %s"
                  % multi_inference_log
              )
      return example, output_features
  
file_path: tfx/tfx/components/bulk_inferrer/prediction_to_example_utils.py
imports: from typing import Any, List, Tuple, Union
  import numpy
  import tensorflow
  from tfx.proto import bulk_inferrer_pb2
  from tensorflow_serving.apis import classification_pb2
  from tensorflow_serving.apis import prediction_log_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: _parse_multi_inference_log(multi_inference_log, output_example_spec) and returns: example,  output_features