class_docstr: Configured metrics for token classification
class_docstr_tok: ["Configured","metrics","for","token","classification"]
docstr: Compute capitalness for a string value
docstr_tok: ["Compute","capitalness","for","a","string","value"]
code: def capitalness(value: str) -> Optional[str]:
      """Compute capitalness for a string value"""
      value = value.strip()
      if not value:
          return None
      if value.isupper():
          return "UPPER"
      if value.islower():
          return "LOWER"
      if value[0].isupper():
          return "FIRST"
      if any([c.isupper() for c in value[1:]]):
          return "MIDDLE"
      return None
  
imports: from typing import Any, ClassVar, Dict, Iterable, List, Optional, Set, Tuple
  from argilla.server.pydantic_v1 import BaseModel, Field
  from argilla.server.services.metrics import ServiceBaseMetric, ServicePythonMetric
  from argilla.server.services.metrics.models import CommonTasksMetrics
  from argilla.server.services.search.model import ServiceRecordsQuery
  from argilla.server.services.tasks.token_classification.model import EntitySpan, ServiceTokenClassificationAnnotation, ServiceTokenClassificationRecord
  from argilla.utils import SpanUtils
label_desc: Use image node_id 2 for calling the TokenClassificationMetrics obj's underlying member method code with example usage: obj.capitalness(value) and returns: None, None, str, str, str, str