code: def test_rank_classification_is_target(self):
      # The example does not have weight feature.
      self.assertEqual(
          postprocessors.rank_classification(
              "blah",
              example={
                  "is_correct": False,
                  "idx": np.array([10, 1]),
                  "targets": [1, 2, 3],
                  "passthrough": "ps_value",
              },
              is_target=True,
          ),
          ((10, 1), False, 1, 3),
      )
  
      self.assertEqual(
          postprocessors.rank_classification(
              "blah",
              example={
                  "is_correct": False,
                  "idx": np.array([10, 1]),
                  "targets": [1, 2, 3],
                  "passthrough": "ps_value",
              },
              is_target=True,
              passthrough_feature_keys=["passthrough"],
          ),
          ((10, 1), False, 1, 3, "ps_value"),
      )
  
      # The example has weight feature.
      self.assertEqual(
          postprocessors.rank_classification(
              "blah",
              example={
                  "is_correct": False,
                  "idx": np.array([10, 1]),
                  "targets": [1, 2, 3],
                  "weight": 0,
                  "passthrough": ["pt1", "pt2"],
              },
              is_target=True,
          ),
          ((10, 1), False, 0, 3),
      )
  
      self.assertEqual(
          postprocessors.rank_classification(
              "blah",
              example={
                  "is_correct": False,
                  "idx": np.array([10, 1]),
                  "targets": [1, 2, 3],
                  "weight": 0,
                  "passthrough": ["pt1", "pt2"],
              },
              is_target=True,
              passthrough_feature_keys=["passthrough"],
          ),
          ((10, 1), False, 0, 3, ["pt1", "pt2"]),
      )
  
file_path: text-to-text-transfer-transformer/t5/data/postprocessors_test.py
imports: from absl.testing import absltest
  import numpy
  from t5.data import postprocessors
label_desc: Use image node_id 10 for calling the PostprocessorsTest obj's underlying member method code with example usage: obj.test_rank_classification_is_target() without return types