code: def test_check_correct_entity_annotations(
      text: Text,
      warnings: int,
      whitespace_tokenizer: WhitespaceTokenizer,
  ):
      reader = RasaYAMLReader()
  
      training_data = reader.reads(text)
      whitespace_tokenizer.process_training_data(training_data)
  
      with pytest.warns(UserWarning) as record:
          EntityExtractorMixin.check_correct_entity_annotations(
              training_data
          )
  
      assert len(record) == warnings
      assert all(
          [excerpt in record[0].message.args[0]]
          for excerpt in ["Misaligned entity annotation in sentence"]
      )
  
file_path: rasa/tests/nlu/extractors/test_extractor.py
imports: from typing import Any, Text, Dict, List
  import pytest
  from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
  from rasa.shared.nlu.constants import TEXT, SPLIT_ENTITIES_BY_COMMA
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.extractors.extractor import EntityExtractorMixin
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.shared.nlu.training_data.formats.rasa_yaml import RasaYAMLReader
label_desc: Use image node_id 3 for calling a global function with example usage: test_check_correct_entity_annotations(text, warnings, whitespace_tokenizer) without return types