code: def test_arguments(self):
      mode = ["micro", "macro"]
      preds = [
          KIEDataSample(
              gt_instances=InstanceData(
                  test_labels=torch.LongTensor([0, 1, 0, 1, 2])
              ),
              pred_instances=InstanceData(
                  test_labels=torch.LongTensor([0, 1, 2, 2, 0])
              ),
          )
      ]
  
      # class 0: tp: 1, fp: 1, fn: 1
      # class 1: tp: 1, fp: 1, fn: 0
      # class 2: tp: 0, fp: 1, fn: 2
      # overall: tp: 2, fp: 3, fn: 3
      # micro_f1: 0.4
      # macro_f1:
  
      metric = F1Metric(num_classes=3, mode=mode, key="test_labels")
      metric.process(None, preds)
      result = metric.evaluate(size=1)
      self.assertAlmostEqual(result["kie/micro_f1"], 0.4, delta=0.01)
      self.assertAlmostEqual(result["kie/macro_f1"], 0.39, delta=0.01)
  
file_path: mmocr/tests/test_evaluation/test_metrics/test_f_metric.py
imports: import unittest
  import torch
  from mmengine.structures import InstanceData
  from mmocr.evaluation import F1Metric
  from mmocr.structures import KIEDataSample
label_desc: Use image node_id 4 for calling the TestF1Metric obj's underlying member method code with example usage: obj.test_arguments() without return types