code: def test_rank_adjustment(self):
      for uprank in ["mask", "sample_weight", "ys"]:
          sample_weight = np.array([0.4, 0.3, 0.2, 0.1])
          y_true = np.array([1.0, 0.0, 1.0, 0.0])
          y_pred = np.array([0.1, 0.2, 0.3, 0.4])
          mask = np.array([True, False, True, True])
  
          if uprank == "mask":
              mask = np.expand_dims(mask, -1)
          elif uprank == "sample_weight":
              sample_weight = np.expand_dims(sample_weight, -1)
          elif uprank == "ys":
              y_true = np.expand_dims(y_true, -1)
              y_pred = np.expand_dims(y_pred, -1)
  
          masked_sample_weight = np.array([0.4, 0.2, 0.1])
          masked_y_true = np.array([1.0, 1.0, 0.0])
          masked_y_pred = np.array([0.1, 0.3, 0.4])
  
          mask = ops.convert_to_tensor(mask)
          y_true = ops.convert_to_tensor(y_true)
          y_pred = ops.convert_to_tensor(y_pred)
          y_pred._keras_mask = mask
  
          loss_fn = ExampleLoss()
          loss = loss_fn(y_true, y_pred, sample_weight=sample_weight)
          self.assertEqual(
              backend.standardize_dtype(loss.dtype), "float32"
          )
          self.assertAllClose(
              np.sum(
                  masked_sample_weight
                  * (masked_y_true - masked_y_pred) ** 2
              )
              / 3,
              loss,
          )
  
imports: import numpy
  import pytest
  from keras import backend
  from keras import losses
  from keras import ops
  from keras import testing
  from keras.losses.loss import Loss
label_desc: Use image node_id 6 for calling the LossTest obj's underlying member method code with example usage: obj.test_rank_adjustment() without return types