code: def test_apply_token_pattern(
      token_pattern: Text,
      tokens: List[Token],
      expected_tokens: List[Token],
  ):
      component_config = {"token_pattern": token_pattern}
  
      tokenizer = create_whitespace_tokenizer(component_config)
      actual_tokens = tokenizer._apply_token_pattern(tokens)
  
      assert len(actual_tokens) == len(expected_tokens)
      for actual_token, expected_token in zip(
          actual_tokens, expected_tokens
      ):
          assert actual_token.text == expected_token.text
          assert actual_token.start == expected_token.start
          assert actual_token.end == expected_token.end
  
imports: from typing import Any, Dict, Optional, Tuple, Text, List
  import pytest
  from rasa.nlu.tokenizers.tokenizer import Token
  from rasa.nlu.constants import TOKENS_NAMES
  from rasa.shared.nlu.constants import TEXT, INTENT, RESPONSE, INTENT_RESPONSE_KEY, ACTION_TEXT, ACTION_NAME
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
label_desc: Use image node_id 11 for calling a global function with example usage: test_apply_token_pattern(token_pattern, tokens, expected_tokens) without return types