code: def test_weighted(self):
      mean_obj = reduction_metrics.Mean(name="mean", dtype="float32")
      mean_obj.update_state([1, 3, 5, 7], sample_weight=[1, 1, 0, 0])
      result = mean_obj.result()
      self.assertAllClose(result, 2.0, atol=1e-3)
  
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 MeanTest obj's underlying member method code with example usage: obj.test_weighted() without return types