code: def test_metrics_for_token_classification(mocked_client):
      dataset = "test_metrics_for_token_classification"
  
      text = "test the f1 metric of the token classification task"
      log(
          TokenClassificationRecord(
              id=1,
              text=text,
              tokens=text.split(),
              prediction=[("a", 0, 4), ("b", 5, 8), ("b", 9, 11)],
              annotation=[("a", 0, 4), ("b", 5, 8), ("a", 9, 11)],
          ),
          name=dataset,
      )
  
      results = f1(dataset)
      assert results
      assert results.data == {
          "f1_macro": pytest.approx(0.75),
          "f1_micro": pytest.approx(0.6666666666666666),
          "a_f1": pytest.approx(0.6666666666666666),
          "a_precision": pytest.approx(1.0),
          "a_recall": pytest.approx(0.5),
          "b_f1": pytest.approx(0.6666666666666666),
          "b_precision": pytest.approx(0.5),
          "b_recall": pytest.approx(1.0),
          "precision_macro": pytest.approx(0.75),
          "precision_micro": pytest.approx(0.6666666666666666),
          "recall_macro": pytest.approx(0.75),
          "recall_micro": pytest.approx(0.6666666666666666),
      }
      results.visualize()
  
imports: import argilla
  import pytest
  from argilla.client.api import load, log
  from argilla.client.models import TokenClassificationRecord
  from argilla.metrics import entity_consistency
  from argilla.metrics.token_classification import Annotations, entity_capitalness, entity_density, entity_labels, f1, mention_length, token_capitalness, token_frequency, token_length, tokens_length, top_k_mentions
  from tests.integration.utils import delete_ignoring_errors
label_desc: Use image node_id 15 for calling a global function with example usage: test_metrics_for_token_classification(mocked_client) without return types