class_docstr: Holds utility methods to work with a tokenized text and entity spans.
  
  Spans must be tuples containing the label (str), start char idx (int), and end char idx (int).
  
  Args:
      text: The text the spans refer to.
      tokens: The tokens of the text.
code: def __init__(self, text: str, tokens: List[str]):
      self._text, self._tokens = text, tokens
  
      self._token_to_char_idx: Dict[int, Tuple[int, int]] = {}
      self._start_to_token_idx: Dict[int, int] = {}
      self._end_to_token_idx: Dict[int, int] = {}
      self._char_to_token_idx: Dict[int, int] = {}
  
      end_idx = 0
      for idx, token in enumerate(tokens):
          start_idx = text.find(token, end_idx)
          if start_idx == -1:
              raise ValueError(
                  f"Token '{token}' not found in text: {text}"
              )
          end_idx = start_idx + len(token)
  
          self._token_to_char_idx[idx] = (start_idx, end_idx)
          self._start_to_token_idx[start_idx] = idx
          self._end_to_token_idx[end_idx] = idx
          for i in range(start_idx, end_idx):
              self._char_to_token_idx[i] = idx
  
          # convention: skip first white space after a token
          try:
              if text[end_idx] == " ":
                  end_idx += 1
          # reached end of text
          except IndexError:
              pass
  
file_path: argilla/src/argilla/utils/span_utils.py
imports: from typing import Dict, List, Optional, Tuple
label_desc: Use image node_id 1 to create a new SpanUtils object  with example: obj = SpanUtils(text, tokens)