code: def test_evaluate_instances_multi_class():
      # Note: no "a" because it would get filtered out by normalize_text()
      metric = ClassificationMetric(delimiter=None)
  
      def _options(correct: str):
          return [
              _Option(text, text == correct) for text in ["d", "b", "c"]
          ]
  
      request_states = [
          _request_state("d", _options("d")),
          _request_state("d", _options("d")),
          _request_state("d", _options("d")),
          _request_state("d", _options("b")),
          _request_state("b", _options("b")),
          _request_state("b", _options("b")),
          _request_state("b", _options("c")),
          _request_state("c", _options("d")),
          _request_state("c", _options("c")),
          _request_state("invalid", _options("c")),
      ]
      assert_stats_equal(
          metric.evaluate_instances(request_states),
          _expected_stats(
              {
                  "d": {"tp": 3, "fp": 1, "tn": 5, "fn": 1},
                  "b": {"tp": 2, "fp": 1, "tn": 6, "fn": 1},
                  "c": {"tp": 1, "fp": 1, "tn": 6, "fn": 2},
              }
          ),
      )
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/metrics/test_classification_metrics.py
imports: from collections import defaultdict
  from typing import Dict, List, NamedTuple
  from pytest import approx
  from helm.benchmark.adaptation.request_state import RequestState
  from helm.benchmark.metrics.classification_metrics import ClassificationMetric
  from helm.benchmark.metrics.statistic import Stat
  from helm.benchmark.scenarios.scenario import Input, Instance, Output, Reference, CORRECT_TAG
  from helm.common.request import Request, RequestResult, Sequence
label_desc: Use image node_id 5 for calling a global function with example usage: test_evaluate_instances_multi_class() and returns: unknown