code: def testPredictList(self):
      temp_eval_export_dir = self._getEvalExportDir()
      (
          _,
          eval_export_dir,
      ) = linear_classifier_multivalent.simple_linear_classifier_multivalent(
          None, temp_eval_export_dir
      )
  
      eval_saved_model = load.EvalSavedModel(eval_export_dir)
      example1 = self._makeExample(animals=["cat"], label=0.0)
      example2 = self._makeExample(animals=["dog"], label=0.0)
      example3 = self._makeExample(animals=["cat", "dog"], label=1.0)
      example4 = self._makeExample(label=0.0)
  
      examples_list = [
          example1.SerializeToString(),
          example2.SerializeToString(),
          example3.SerializeToString(),
          example4.SerializeToString(),
      ]
      features_predictions_labels_list = (
          self.predict_injective_example_list(
              eval_saved_model, examples_list
          )
      )
  
      # Check that SparseFeatures were correctly populated.
      self.assertAllEqual(
          np.array([b"cat"], dtype=object),
          features_predictions_labels_list[0]
          .features["animals"][encoding.NODE_SUFFIX]
          .values,
      )
      self.assertAllEqual(
          np.array([b"dog"], dtype=object),
          features_predictions_labels_list[1]
          .features["animals"][encoding.NODE_SUFFIX]
          .values,
      )
      self.assertAllEqual(
          np.array([b"cat", b"dog"], dtype=object),
          features_predictions_labels_list[2]
          .features["animals"][encoding.NODE_SUFFIX]
          .values,
      )
      self.assertAllEqual(
          np.array([], dtype=object),
          features_predictions_labels_list[3]
          .features["animals"][encoding.NODE_SUFFIX]
          .values,
      )
  
      eval_saved_model.metrics_reset_update_get_list(examples_list)
      metric_values = eval_saved_model.get_metric_values()
  
      self.assertDictElementsAlmostEqual(
          metric_values,
          {
              "accuracy": 1.0,
              "label/mean": 0.25,
          },
      )
  
imports: import os
  import numpy
  import tensorflow
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import load
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.eval_saved_model.example_trainers import control_dependency_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import csv_linear_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import custom_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import dnn_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fake_multi_examples_per_input_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fake_sequence_to_prediction
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator_no_labels
  from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier_multivalent
  from tensorflow_model_analysis.eval_saved_model.example_trainers import multi_head
  from tensorflow_model_analysis.post_export_metrics import metrics
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 8 for calling the IntegrationTest obj's underlying member method code with example usage: obj.testPredictList() without return types