code: def test_base_slot_metrics(self):
      cases = [
          (empty_slots, empty_slots, {"jga": 1}),
          (
              basic_slots,
              basic_slots,
              {"jga": 1, "slot_p": 1, "slot_r": 1, "slot_f1": 1},
          ),
          (
              basic_slots,
              partial_slots,
              {
                  "jga": 0,
                  "slot_p": 0.5,
                  "slot_r": float(1.0 / 3),
                  "slot_f1": 0.4,
              },
          ),
      ]
      for teacher, predicted, result in cases:
          metric = SlotMetrics(
              teacher_slots=teacher, predicted_slots=predicted
          )
          for key in result:
              self.assertEqual(result[key], metric.report()[key])
  
file_path: ParlAI/tests/tod/test_tod_teacher_metrics.py
imports: import unittest
  from math import isnan
  from parlai.core.metrics import AverageMetric
  from parlai.core.tod.teacher_metrics import SlotF1Metric, SlotMetrics
label_desc: Use image node_id 1 for calling the TestSlotMetrics obj's underlying member method code with example usage: obj.test_base_slot_metrics() without return types