code: def test_match_tokens_with_text():
      """
      Test the conversion of pretokenized text to Document
      """
      doc = utils.match_tokens_with_text(
          [["This", "is", "a", "test"]], "Thisisatest"
      )
      expected_offsets = [[(0, 4), (4, 6), (6, 7), (7, 11)]]
      check_offsets(doc, expected_offsets)
  
      doc = utils.match_tokens_with_text(
          [["This", "is", "a", "test"], ["unban", "mox", "opal", "!"]],
          "Thisisatest  unban mox  opal!",
      )
      expected_offsets = [
          [(0, 4), (4, 6), (6, 7), (7, 11)],
          [(13, 18), (19, 22), (24, 28), (28, 29)],
      ]
      check_offsets(doc, expected_offsets)
  
      with pytest.raises(ValueError):
          doc = utils.match_tokens_with_text(
              [["This", "is", "a", "test"]], "Thisisatestttt"
          )
  
      with pytest.raises(ValueError):
          doc = utils.match_tokens_with_text(
              [["This", "is", "a", "test"]], "Thisisates"
          )
  
      with pytest.raises(ValueError):
          doc = utils.match_tokens_with_text(
              [["This", "iz", "a", "test"]], "Thisisatest"
          )
  
file_path: stanza/stanza/tests/tokenization/test_tokenize_utils.py
imports: import pytest
  import stanza
  from stanza import Pipeline
  from stanza.tests import *
  from stanza.models.common import doc
  from stanza.models.tokenization import data
  from stanza.models.tokenization import utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_match_tokens_with_text() without return types