code: def extract_offsets(sentence, tokens=None, tokenizer=tokenize):
      """
      ```
      extracts character
  
      Args:
        sentence (str): text
        tokens (list): list of tokens from sentence.  If None, tokens will be generated using supplied tokenizer.
        tokenizer (Callable):  a callable that accepts text and returns a list of tokens
      Return:
        list of dictionaries of the form {'token': <the token>, 'start': start character index, 'end': end character index}
      ```
      """
      s = sentence
      tokens = tokenizer(sentence)
      offsets = []
      last_end = 0
      for t in tokens:
          if t == "":  # t[0] doesn't exist for empty strings
              continue
          # find start of current token
          for start_ind in range(last_end, len(sentence)):
              if sentence[start_ind] == t[0]:
                  break
          end_ind = len(sentence)
          for end_ind in range(start_ind + 1, len(sentence)):
              if (end_ind - start_ind) >= len(t):
                  break
          d = {
              "token": t,
              "start": start_ind,
              "end": end_ind,
          }
          offsets.append(d)
          last_end = end_ind
      return offsets
  
imports: from subprocess import DEVNULL, PIPE, Popen
  from ..imports import *
label_desc: Use image node_id 24 for calling a global function with example usage: extract_offsets(sentence, tokens, tokenizer) and returns: offsets