code: def test_dataset_labels_metric(mocked_client):
      dataset = "test_dataset_labels_metric"
      records = [
          TextClassificationRecord(
              id=i,
              text="aa" * i,
              prediction=[("A", 0.3)],
          )
          for i in range(0, 1000)
      ]
  
      records.extend(
          [
              TextClassificationRecord(
                  id=i,
                  text="aa" * i,
                  annotation="B",
              )
              for i in range(1000, 2000)
          ]
      )
      records.extend(
          [
              TextClassificationRecord(
                  id=i,
                  text="aa" * i,
                  prediction=[("C", 0.3)],
                  annotation=["D"],
              )
              for i in range(2000, 3000)
          ]
      )
      log(
          name=dataset,
          records=records,
      )
  
      metric = singleton.active_api().compute_metric(
          dataset,
          metric="dataset_labels",
      )
      assert set(metric.results["labels"]) == {"C", "A", "B", "D"}
  
file_path: argilla/tests/integration/metrics/test_text_classification.py
imports: import argilla
  from argilla.client import singleton
  from argilla.client.api import log
  from argilla.client.models import TextClassificationRecord
  from argilla.metrics.text_classification import f1, f1_multilabel
label_desc: Use image node_id 3 for calling a global function with example usage: test_dataset_labels_metric(mocked_client) without return types