code: def _token_offsets_reference(enc, tokens):
      text = enc.decode(tokens, errors="strict")
      res = []
      for i in range(len(tokens)):
          prefix = enc.decode(tokens[:i], errors="ignore")
          res.append(_common_prefix_len(text, prefix))
      return res
  
file_path: tiktoken/tests/test_offsets.py
imports: from typing import Callable
  import hypothesis
  import pytest
  from hypothesis import strategies
  import tiktoken
  from .test_helpers import MAX_EXAMPLES, SOME_ENCODING_FACTORIES
label_desc: Use image node_id 2 for calling a global function with example usage: _token_offsets_reference(enc, tokens) and returns: res