code: def test_rank_classification_raise(self):
      with self.assertRaisesWithLiteralMatch(
          ValueError, "`targets` should contain 4 elements but has 2."
      ):
          metrics.rank_classification(
              [
                  ((0, 0), True),
                  ((0, 1), True),
              ],
              [0.1, 0.5],
              num_classes=2,
          )
  
      with self.assertRaisesWithLiteralMatch(
          ValueError,
          "The first element of `targets` ('idx') should be 2-dimensional. Got "
          "0.",
      ):
          metrics.rank_classification(
              [
                  (0, True, 1.0, 1),
                  (0, True, 1.0, 1),
              ],
              [0.1, 0.5],
              num_classes=2,
          )
  
imports: from unittest import mock
  from absl.testing import absltest
  import numpy
  import seqio
  import sklearn.metrics
  from t5.evaluation import metrics
  from t5.evaluation import test_utils
label_desc: Use image node_id 34 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_rank_classification_raise() without return types