code: def from_client(cls, record: ClientTokenClassificationRecord):
      prediction = None
      if record.prediction is not None:
          prediction = TokenClassificationAnnotation(
              entities=[
                  EntitySpan(label=ent[0], start=ent[1], end=ent[2])
                  if len(ent) == 3
                  else EntitySpan(
                      label=ent[0],
                      start=ent[1],
                      end=ent[2],
                      score=ent[3],
                  )
                  for ent in record.prediction
              ],
              agent=record.prediction_agent or MACHINE_NAME,
          )
  
      annotation = None
      if record.annotation is not None:
          annotation = TokenClassificationAnnotation(
              entities=[
                  EntitySpan(label=ent[0], start=ent[1], end=ent[2])
                  for ent in record.annotation
              ],
              agent=record.annotation_agent or MACHINE_NAME,
          )
  
      return cls(
          tokens=record.tokens,
          text=record.text,
          prediction=prediction,
          annotation=annotation,
          vectors=cls._from_client_vectors(record.vectors),
          status=record.status,
          id=record.id,
          metadata=record.metadata,
          event_timestamp=record.event_timestamp,
      )
  
imports: from datetime import datetime
  from typing import Dict, List, Optional, Union
  from argilla._constants import DEFAULT_MAX_KEYWORD_LENGTH
  from argilla.client.models import TokenClassificationRecord
  from argilla.client.sdk.commons.models import MACHINE_NAME, BaseAnnotation, BaseRecord, PredictionStatus, ScoreRange, SdkVectorSearch, TaskStatus, UpdateDatasetRequest
  from argilla.pydantic_v1 import BaseModel, Field, validator
label_desc: Use image node_id 2 for calling the CreationTokenClassificationRecord obj's underlying member method code with example usage: obj.from_client(cls, record) and returns: cls