code: def test_count_vector_featurizer(
      sentence: Text,
      expected: List[List[int]],
      expected_cls: List[List[int]],
      create_featurizer: Callable[..., CountVectorsFeaturizer],
      whitespace_tokenizer: WhitespaceTokenizer,
  ):
      ftr = create_featurizer()
  
      train_message = Message(data={TEXT: sentence})
      test_message = Message(data={TEXT: sentence})
  
      whitespace_tokenizer.process([train_message])
      whitespace_tokenizer.process([test_message])
  
      ftr.train(TrainingData([train_message]))
  
      ftr.process([test_message])
  
      seq_vecs, sen_vecs = test_message.get_sparse_features(TEXT, [])
      if seq_vecs:
          seq_vecs = seq_vecs.features
      if sen_vecs:
          sen_vecs = sen_vecs.features
  
      assert isinstance(seq_vecs, scipy.sparse.coo_matrix)
      assert isinstance(sen_vecs, scipy.sparse.coo_matrix)
  
      actual_seq_vecs = seq_vecs.toarray()
      actual_sen_vecs = sen_vecs.toarray()
  
      assert np.all(actual_seq_vecs[0] == expected)
      assert np.all(actual_sen_vecs[-1] == expected_cls)
  
imports: from typing import List, Any, Text, Dict, Callable, Optional
  import dataclasses
  import numpy
  import pytest
  import scipy.sparse
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.nlu.constants import TOKENS_NAMES, SPACY_DOCS
  from rasa.nlu.utils.spacy_utils import SpacyModel
  from rasa.shared.nlu.constants import TEXT, INTENT, RESPONSE, ACTION_TEXT, ACTION_NAME
  from rasa.nlu.tokenizers.tokenizer import Token
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer import CountVectorsFeaturizer
label_desc: Use image node_id 3 for calling a global function with example usage: test_count_vector_featurizer(sentence, expected, expected_cls, create_featurizer, whitespace_tokenizer) without return types