code: def testEvaluateNoSlicingAddPostExportAndCustomMetricsUnsupervisedModel(
      self,
  ):
      # Mainly for testing that the ExampleCount post export metric works with
      # unsupervised models.
      temp_eval_export_dir = self._getEvalExportDir()
      (
          _,
          eval_export_dir,
      ) = fixed_prediction_estimator_no_labels.simple_fixed_prediction_estimator_no_labels(
          None, temp_eval_export_dir
      )
      eval_shared_model = self.createTestEvalSharedModel(
          eval_saved_model_path=eval_export_dir,
          add_metrics_callbacks=[
              post_export_metrics.example_count(),
              post_export_metrics.example_weight(
                  example_weight_key="prediction"
              ),
          ],
      )
      extractors = [
          legacy_predict_extractor.PredictExtractor(eval_shared_model),
          slice_key_extractor.SliceKeyExtractor(),
      ]
  
      with beam.Pipeline() as pipeline:
          example1 = self._makeExample(prediction=1.0)
          example2 = self._makeExample(prediction=2.0)
  
          (metrics, plots), _ = (
              pipeline
              | "Create"
              >> beam.Create(
                  [
                      example1.SerializeToString(),
                      example2.SerializeToString(),
                  ]
              )
              | "InputsToExtracts" >> model_eval_lib.InputsToExtracts()
              | "Extract"
              >> tfma_unit.Extract(
                  extractors=extractors
              )  # pylint: disable=no-value-for-parameter
              | "ComputeMetricsAndPlots"
              >> metrics_and_plots_evaluator._ComputeMetricsAndPlots(
                  eval_shared_model=eval_shared_model
              )
          )
  
          def check_result(got):
              try:
                  self.assertEqual(1, len(got), "got: %s" % got)
                  (slice_key, value) = got[0]
                  self.assertEqual((), slice_key)
                  self.assertDictElementsAlmostEqual(
                      got_values_dict=value,
                      expected_values_dict={
                          "average_loss": 2.5,
                          metric_keys.EXAMPLE_COUNT: 2.0,
                          metric_keys.EXAMPLE_WEIGHT: 3.0,
                      },
                  )
              except AssertionError as err:
                  raise util.BeamAssertException(err)
  
          util.assert_that(metrics, check_result, label="metrics")
          util.assert_that(plots, util.is_empty(), label="plots")
  
imports: import os
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.api import tfma_unit
  from tensorflow_model_analysis.eval_saved_model import testutil
  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.evaluators import legacy_metrics_and_plots_evaluator
  from tensorflow_model_analysis.extractors import legacy_predict_extractor
  from tensorflow_model_analysis.extractors import slice_key_extractor
  from tensorflow_model_analysis.post_export_metrics import metric_keys
  from tensorflow_model_analysis.post_export_metrics import metrics
  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 7 for calling the EvaluateMetricsAndPlotsTest obj's underlying member method code with example usage: obj.testEvaluateNoSlicingAddPostExportAndCustomMetricsUnsupervisedModel() without return types