code: def test_train_tokenizer(
      text, expected_tokens, expected_indices, spacy_nlp
  ):
      tk = SpacyTokenizer(SpacyTokenizer.get_default_config())
  
      message = Message.build(text=text)
      message.set(SPACY_DOCS[TEXT], spacy_nlp(text))
      message.set(RESPONSE, text)
      message.set(SPACY_DOCS[RESPONSE], spacy_nlp(text))
  
      training_data = TrainingData()
      training_data.training_examples = [message]
  
      tk.process_training_data(training_data)
  
      for attribute in [RESPONSE, TEXT]:
          tokens = training_data.training_examples[0].get(
              TOKENS_NAMES[attribute]
          )
  
          assert [t.text for t in tokens] == expected_tokens
          assert [t.start for t in tokens] == [
              i[0] for i in expected_indices
          ]
          assert [t.end for t in tokens] == [
              i[1] for i in expected_indices
          ]
  
file_path: rasa/tests/nlu/tokenizers/test_spacy_tokenizer.py
imports: import pytest
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.constants import SPACY_DOCS, TOKENS_NAMES
  from rasa.shared.nlu.constants import TEXT, INTENT, RESPONSE
  from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
label_desc: Use image node_id 3 for calling a global function with example usage: test_train_tokenizer(text, expected_tokens, expected_indices, spacy_nlp) without return types