code: def test_weighted(self):
      mse_obj = reduction_metrics.MeanMetricWrapper(
          fn=mse, name="mse", dtype="float32"
      )
      y_true = np.array(
          [
              [0, 1, 0, 1, 0],
              [0, 0, 1, 1, 1],
              [1, 1, 1, 1, 0],
              [0, 0, 0, 0, 1],
          ]
      )
      y_pred = np.array(
          [
              [0, 0, 1, 1, 0],
              [1, 1, 1, 1, 1],
              [0, 1, 0, 1, 0],
              [1, 1, 1, 1, 1],
          ]
      )
      sample_weight = np.array([1.0, 1.5, 2.0, 2.5])
      result = mse_obj(y_true, y_pred, sample_weight=sample_weight)
      self.assertAllClose(0.54285, result, atol=1e-5)
  
imports: import numpy
  from keras import testing
  from keras.metrics import reduction_metrics
  from keras.saving import register_keras_serializable
label_desc: Use image node_id 3 for calling the MetricWrapperTest obj's underlying member method code with example usage: obj.test_weighted() without return types