code: def test_weighted_from_logits(self):
      scce_obj = metrics.SparseCategoricalCrossentropy(from_logits=True)
  
      y_true = np.array([1, 2])
      logits = np.array([[1, 9, 0], [1, 8, 1]], dtype=np.float32)
      sample_weight = np.array([1.5, 2.0])
      result = scce_obj(y_true, logits, sample_weight=sample_weight)
      self.assertAllClose(result, 4.0012, atol=1e-3)
  
imports: import numpy
  from keras import metrics
  from keras import testing
label_desc: Use image node_id 5 for calling the SparseCategoricalCrossentropyTest obj's underlying member method code with example usage: obj.test_weighted_from_logits() without return types