code: def test_persist_load_for_finetuning(
      create_featurizer: Callable[..., RegexFeaturizer],
      default_model_storage: ModelStorage,
      default_execution_context: ExecutionContext,
      resource: Resource,
      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")
      training_data = TrainingData([message], regex_features=patterns)
      whitespace_tokenizer.process_training_data(training_data)
  
      featurizer.train(training_data)
  
      loaded_featurizer = RegexFeaturizer.load(
          RegexFeaturizer.get_default_config(),
          default_model_storage,
          resource,
          dataclasses.replace(
              default_execution_context, is_finetuning=True
          ),
      )
  
      # Test component loaded in finetune mode and also with
      # same patterns as before and vocabulary statistics
      assert (
          loaded_featurizer.known_patterns == featurizer.known_patterns
      )
      assert loaded_featurizer.finetune_mode
  
      new_lookups = [
          {
              "name": "plates",
              "elements": "data/test/lookup_tables/plates.txt",
          }
      ]
  
      training_data = TrainingData()
      training_data.lookup_tables = new_lookups
      loaded_featurizer.train(training_data)
  
      # Test merging of a new pattern to an already trained component.
      assert len(loaded_featurizer.known_patterns) == 4
  
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 10 for calling a global function with example usage: test_persist_load_for_finetuning(create_featurizer, default_model_storage, default_execution_context, resource, whitespace_tokenizer) without return types