code: def __check_label_entities__(
      label_schema: Set[str],
      annotation: ServiceTokenClassificationAnnotation,
  ):
      if not annotation:
          return
      for entity in annotation.entities:
          if entity.label not in label_schema:
              raise BadRequestError(
                  detail=f"Provided records contain the {entity.label} label,"
                  " that is not included in the labels schema."
                  "\nPlease, annotate your records using labels defined in the labels schema."
              )
  
file_path: argilla/src/argilla/server/apis/v0/validators/token_classification.py
imports: from typing import List, Set
  from fastapi import Depends
  from argilla.server.apis.v0.models.dataset_settings import TokenClassificationSettings
  from argilla.server.errors import BadRequestError, EntityNotFoundError
  from argilla.server.models import User
  from argilla.server.schemas.v0.datasets import Dataset
  from argilla.server.services.datasets import DatasetsService
  from argilla.server.services.metrics import MetricsService
  from argilla.server.services.tasks.token_classification.metrics import DatasetLabels
  from argilla.server.services.tasks.token_classification.model import ServiceTokenClassificationAnnotation, ServiceTokenClassificationRecord
label_desc: Use image node_id 3 for calling the DatasetValidator obj's underlying member method code with example usage: obj.__check_label_entities__(label_schema, annotation) without return types