code: def test_weighted(self):
      cat_acc_obj = accuracy_metrics.CategoricalAccuracy(
          name="categorical_accuracy", dtype="float32"
      )
      y_true = np.array([[0, 0, 1], [0, 1, 0]])
      y_pred = np.array([[0.1, 0.9, 0.8], [0.05, 0.95, 0]])
      sample_weight = np.array([0.7, 0.3])
      cat_acc_obj.update_state(
          y_true, y_pred, sample_weight=sample_weight
      )
      result = cat_acc_obj.result()
      self.assertAllClose(result, 0.3, 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 CategoricalAccuracyTest obj's underlying member method code with example usage: obj.test_weighted() without return types