code: def offset_to_token_idx(token_offsets, ch_idx):
      """Returns the idx of the token at the given character idx"""
      n_tokens = len(token_offsets)
      for i in range(n_tokens):
          if (i + 1 == n_tokens) or (
              token_offsets[i] <= ch_idx < token_offsets[i + 1]
          ):
              return i
  
file_path: FARM/farm/data_handler/nq_utils.py
imports: import logging
  import re
  import numpy
  from farm.data_handler.samples import Sample
label_desc: Use image node_id 10 for calling a global function with example usage: offset_to_token_idx(token_offsets, ch_idx) and returns: i