code: def test_spacy_training_sample_alignment(
      spacy_nlp_component: SpacyNLP, spacy_model: SpacyModel
  ):
      from spacy.tokens import Doc
  
      m1 = Message.build(text="I have a feeling", intent="feeling")
      m2 = Message.build(text="", intent="feeling")
      m3 = Message.build(text="I am the last message", intent="feeling")
      td = TrainingData(training_examples=[m1, m2, m3])
  
      attribute_docs = spacy_nlp_component._docs_for_training_data(
          spacy_model.model, td
      )
  
      assert isinstance(attribute_docs["text"][0], Doc)
      assert isinstance(attribute_docs["text"][1], Doc)
      assert isinstance(attribute_docs["text"][2], Doc)
  
      assert [t.text for t in attribute_docs["text"][0]] == [
          "i",
          "have",
          "a",
          "feeling",
      ]
      assert [t.text for t in attribute_docs["text"][1]] == []
      assert [t.text for t in attribute_docs["text"][2]] == [
          "i",
          "am",
          "the",
          "last",
          "message",
      ]
  
imports: from typing import Any, Dict, Text
  import numpy
  import pytest
  from rasa.nlu.utils.spacy_utils import SpacyModel, SpacyNLP
  from rasa.shared.nlu.training_data import loading
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.featurizers.dense_featurizer.spacy_featurizer import SpacyFeaturizer
  from rasa.nlu.constants import SPACY_DOCS
  from rasa.shared.nlu.constants import TEXT, INTENT, RESPONSE
label_desc: Use image node_id 4 for calling a global function with example usage: test_spacy_training_sample_alignment(spacy_nlp_component, spacy_model) without return types