docstr: Checks that we get the correct number of sub tokens
docstr_tok: ["Checks","that","we","get","the","correct","number","of","sub","tokens"]
code: def check_subtokens(
      texts: List[Text],
      messages: List[Message],
      expected_number_of_sub_tokens: List[List[float]],
      whitespace_tokenizer: WhitespaceTokenizer,
  ):
      """Checks that we get the correct number of sub tokens"""
      for index, message in enumerate(messages):
          assert [
              t.get(NUMBER_OF_SUB_TOKENS)
              for t in message.get(TOKENS_NAMES[TEXT])
          ] == expected_number_of_sub_tokens[index]
          assert len(message.get(TOKENS_NAMES[TEXT])) == len(
              whitespace_tokenizer.tokenize(
                  Message.build(text=texts[index]), TEXT
              )
          )
  
imports: import os
  from typing import Text, List, Dict, Tuple, Any, Callable
  import numpy
  import pytest
  import logging
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.logging import LogCaptureFixture
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.nlu.constants import TOKENS_NAMES, NUMBER_OF_SUB_TOKENS
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  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.lm_featurizer import LanguageModelFeaturizer
  from rasa.shared.nlu.constants import TEXT, INTENT
  from rasa.nlu.tokenizers.tokenizer import Token
label_desc: Use image node_id 1 for calling the TestSubTokensTrainAndProcess obj's underlying member method code with example usage: obj.check_subtokens(texts, messages, expected_number_of_sub_tokens, whitespace_tokenizer) without return types