code: def test_weighted(self):
      acc_obj = accuracy_metrics.Accuracy(
          name="accuracy", dtype="float32"
      )
      y_true = np.array([[1], [2], [3], [4]])
      y_pred = np.array([[0], [2], [3], [4]])
      sample_weight = np.array([1, 1, 0, 0])
      acc_obj.update_state(y_true, y_pred, sample_weight=sample_weight)
      result = acc_obj.result()
      self.assertAllClose(result, 0.5, atol=1e-3)
  
imports: import re
  import numpy
  from keras import testing
  from keras.metrics import accuracy_metrics
label_desc: Use image node_id 3 for calling the AccuracyTest obj's underlying member method code with example usage: obj.test_weighted() without return types