code: def test_convert_featurizer_number_of_sub_tokens(
      create_or_load_convert_featurizer: Callable[
          [Dict[Text, Any]], ConveRTFeaturizer
      ],
      text: Text,
      expected_number_of_sub_tokens: List[int],
      monkeypatch: MonkeyPatch,
      whitespace_tokenizer: WhitespaceTokenizer,
  ):
      monkeypatch.setattr(
          ConveRTFeaturizer, "_validate_model_url", lambda _: None
      )
      component_config = {
          FEATURIZER_CLASS_ALIAS: "alias",
          "model_url": RESTRICTED_ACCESS_URL,
      }
      featurizer = create_or_load_convert_featurizer(component_config)
  
      message = Message.build(text=text)
      td = TrainingData([message])
      whitespace_tokenizer.process_training_data(td)
  
      tokens = featurizer.tokenize(message, attribute=TEXT)
  
      assert [
          t.get(NUMBER_OF_SUB_TOKENS) for t in tokens
      ] == expected_number_of_sub_tokens
  
imports: import numpy
  import pytest
  from typing import Text, Optional, List, Tuple, Dict, Any, Callable
  from pathlib import Path
  import os
  from _pytest.monkeypatch import MonkeyPatch
  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.constants import FEATURIZER_CLASS_ALIAS, TOKENS_NAMES, NUMBER_OF_SUB_TOKENS
  from rasa.shared.nlu.constants import TEXT, INTENT, RESPONSE
  from rasa.nlu.featurizers.dense_featurizer.convert_featurizer import ConveRTFeaturizer, RESTRICTED_ACCESS_URL, ORIGINAL_TF_HUB_MODULE_URL
  from rasa.exceptions import RasaException
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.storage import ModelStorage
  from rasa.engine.storage.resource import Resource
label_desc: Use image node_id 6 for calling a global function with example usage: test_convert_featurizer_number_of_sub_tokens(create_or_load_convert_featurizer, text, expected_number_of_sub_tokens, monkeypatch, whitespace_tokenizer) without return types