code: def test_token_classification_validations():
      with pytest.raises(
          AssertionError,
          match=(
              "Missing fields: "
              "At least one of `text` or `tokens` argument must be provided!"
          ),
      ):
          TokenClassificationRecord()
  
      tokens = ["test", "text"]
      annotation = [("test", 0, 4)]
      with pytest.raises(
          AssertionError,
          match=(
              "Missing field `text`: "
              "char level spans must be provided with a raw text sentence"
          ),
      ):
          TokenClassificationRecord(
              tokens=tokens, annotation=annotation
          )
  
      with pytest.raises(
          AssertionError,
          match=(
              "Missing field `text`: "
              "char level spans must be provided with a raw text sentence"
          ),
      ):
          TokenClassificationRecord(
              tokens=tokens, prediction=annotation
          )
  
      TokenClassificationRecord(
          text=" ".join(tokens), tokens=tokens, prediction=annotation
      )
  
      record = TokenClassificationRecord(tokens=tokens)
      assert record.text == "test text"
  
imports: import datetime
  import json
  import uuid
  from typing import Any, Optional
  import numpy
  import pandas
  import pytest
  from argilla.client.models import Text2TextRecord, TextClassificationRecord, TokenClassificationRecord, _Validators
  from pydantic import ValidationError
label_desc: Use image node_id 6 for calling a global function with example usage: test_token_classification_validations() without return types