code: def test_regex_featurizer_train(
      create_featurizer: Callable[..., RegexFeaturizer],
      whitespace_tokenizer: WhitespaceTokenizer,
  ):
      patterns = [
          {"pattern": "[0-9]+", "name": "number", "usage": "intent"},
          {"pattern": "\\bhey*", "name": "hello", "usage": "intent"},
          {"pattern": "[0-1]+", "name": "binary", "usage": "intent"},
      ]
  
      featurizer = create_featurizer()
      sentence = "hey how are you today 19.12.2019 ?"
      message = Message(data={TEXT: sentence})
      message.set(RESPONSE, sentence)
      message.set(INTENT, "intent")
  
      whitespace_tokenizer.process_training_data(
          TrainingData([message])
      )
      training_data = TrainingData([message], regex_features=patterns)
  
      featurizer.train(training_data)
      featurizer.process_training_data(training_data)
  
      expected = np.array([0, 1, 0])
      expected_cls = np.array([1, 1, 1])
  
      seq_vecs, sen_vec = message.get_sparse_features(TEXT, [])
      if seq_vecs:
          seq_vecs = seq_vecs.features
      if sen_vec:
          sen_vec = sen_vec.features
  
      assert (6, 3) == seq_vecs.shape
      assert (1, 3) == sen_vec.shape
      assert np.all(seq_vecs.toarray()[0] == expected)
      assert np.all(sen_vec.toarray()[-1] == expected_cls)
  
      seq_vecs, sen_vec = message.get_sparse_features(RESPONSE, [])
      if seq_vecs:
          seq_vecs = seq_vecs.features
      if sen_vec:
          sen_vec = sen_vec.features
  
      assert (6, 3) == seq_vecs.shape
      assert (1, 3) == sen_vec.shape
      assert np.all(seq_vecs.toarray()[0] == expected)
      assert np.all(sen_vec.toarray()[-1] == expected_cls)
  
      seq_vecs, sen_vec = message.get_sparse_features(INTENT, [])
      if seq_vecs:
          seq_vecs = seq_vecs.features
      if sen_vec:
          sen_vec = sen_vec.features
  
      assert seq_vecs is None
      assert sen_vec is None
  
imports: from typing import Text, List, Any, Tuple, Callable, Dict, Optional
  import dataclasses
  import numpy
  import pytest
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.featurizers.sparse_featurizer.regex_featurizer import RegexFeaturizer
  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
  from rasa.nlu.constants import SPACY_DOCS, TOKENS_NAMES
  from rasa.shared.nlu.constants import TEXT, INTENT, RESPONSE
  from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
label_desc: Use image node_id 7 for calling a global function with example usage: test_regex_featurizer_train(create_featurizer, whitespace_tokenizer) without return types