code: def testAssertMetricsComputedWithBeamAre(self):
      temp_eval_export_dir = self._getEvalExportDir()
      (
          _,
          eval_export_dir,
      ) = fixed_prediction_estimator.simple_fixed_prediction_estimator(
          None, temp_eval_export_dir
      )
      examples = [
          self.makeExample(prediction=0.0, label=1.0),
          self.makeExample(prediction=0.7, label=0.0),
          self.makeExample(prediction=0.8, label=1.0),
          self.makeExample(prediction=1.0, label=1.0),
      ]
      self.assertMetricsComputedWithBeamAre(
          eval_saved_model_path=eval_export_dir,
          serialized_examples=examples,
          expected_metrics={
              "average_loss": (1.0 + 0.49 + 0.04 + 0.00) / 4.0
          },
      )
  
file_path: model-analysis/tensorflow_model_analysis/api/tfma_unit_test.py
imports: import os
  import apache_beam
  import tensorflow
  from tensorflow_model_analysis.api import tfma_unit
  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_extra_fields
  from tensorflow_model_analysis.post_export_metrics import metric_keys
  from tensorflow_model_analysis.post_export_metrics import post_export_metrics
  from tensorflow_model_analysis.slicer import slicer_lib
label_desc: Use image node_id 4 for calling the TFMAUnitTest obj's underlying member method code with example usage: obj.testAssertMetricsComputedWithBeamAre() without return types