code: def testBoundedValueChecks(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.8, label=1.0),
      ]
  
      self.assertMetricsComputedWithBeamAre(
          eval_saved_model_path=eval_export_dir,
          serialized_examples=examples,
          expected_metrics={"average_loss": 0.04},
      )
  
      self.assertMetricsComputedWithoutBeamAre(
          eval_saved_model_path=eval_export_dir,
          serialized_examples=examples,
          expected_metrics={
              "average_loss": tfma_unit.BoundedValue(
                  lower_bound=0.03, upper_bound=0.05
              )
          },
      )
  
      with self.assertRaisesRegex(
          AssertionError,
          "expecting key average_loss to have value between",
      ):
          self.assertMetricsComputedWithoutBeamAre(
              eval_saved_model_path=eval_export_dir,
              serialized_examples=examples,
              expected_metrics={
                  "average_loss": tfma_unit.BoundedValue(
                      upper_bound=0.01
                  )
              },
          )
  
      with self.assertRaisesRegex(
          AssertionError,
          "expecting key average_loss to have value between",
      ):
          self.assertMetricsComputedWithoutBeamAre(
              eval_saved_model_path=eval_export_dir,
              serialized_examples=examples,
              expected_metrics={
                  "average_loss": tfma_unit.BoundedValue(
                      lower_bound=0.10
                  )
              },
          )
  
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 3 for calling the TFMAUnitTest obj's underlying member method code with example usage: obj.testBoundedValueChecks() without return types