code: def test_weighted(self):
      self.setup()
      poisson_obj = metrics.Poisson()
      sample_weight = np.asarray([1.2, 3.4], dtype=np.float32).reshape(
          (2, 1)
      )
  
      result = poisson_obj(
          self.y_true, self.y_pred, sample_weight=sample_weight
      )
      sample_weight = np.asarray(
          [1.2, 1.2, 1.2, 3.4, 3.4, 3.4], dtype=np.float32
      ).reshape((2, 3))
      expected_result = np.multiply(
          self.expected_results, sample_weight
      )
      expected_result = np.sum(expected_result) / np.sum(sample_weight)
      self.assertAllClose(result, expected_result, atol=1e-3)
  
imports: import numpy
  from keras import metrics
  from keras import testing
label_desc: Use image node_id 4 for calling the PoissonTest obj's underlying member method code with example usage: obj.test_weighted() without return types