code: def testRegressionErrorWithWeights(self, metric, expected_value):
      computations = metric.computations(example_weighted=True)
      computation = computations[0]
      example1 = {
          "labels": np.array([0.1, 0.3, 0.5]),
          "predictions": np.array([1, 0, 2]),
          "example_weights": np.array([0.1, 0.5, 1]),
      }
      example2 = {
          "labels": np.array([1, 2, 3]),
          "predictions": np.array([0.5, 1.0, 5]),
          "example_weights": np.array([1.0]),
      }
      example3 = {
          "labels": np.array([3]),
          "predictions": np.array([5]),
          "example_weights": np.array([1.0]),
      }
      with beam.Pipeline() as pipeline:
          # pylint: disable=no-value-for-parameter
          result = (
              pipeline
              | "Create" >> beam.Create([example1, example2, example3])
              | "Process"
              >> beam.Map(metric_util.to_standard_metric_inputs)
              | "AddSlice" >> beam.Map(lambda x: ((), x))
              | "ComputeMetric"
              >> beam.CombinePerKey(computation.combiner)
          )
  
          # pylint: enable=no-value-for-parameter
          def check_result(got):
              try:
                  self.assertLen(got, 1)
                  got_slice_key, got_metrics = got[0]
                  self.assertEqual(got_slice_key, ())
                  key = computation.keys[0]
                  self.assertIn(key, got_metrics)
                  self.assertAlmostEqual(
                      got_metrics[key], expected_value, places=5
                  )
              except AssertionError as err:
                  raise util.BeamAssertException(err)
  
          util.assert_that(result, check_result, label="result")
  
file_path: model-analysis/tensorflow_model_analysis/metrics/mean_regression_error_test.py
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  from tensorflow_model_analysis.metrics import mean_regression_error
  from tensorflow_model_analysis.metrics import metric_util
label_desc: Use image node_id 1 for calling the MeanRegressionErrorTest obj's underlying member method code with example usage: obj.testRegressionErrorWithWeights(metric, expected_value) without return types