code: def test_train_model_checkpointing(
      create_response_selector: Callable[
          [Dict[Text, Any]], ResponseSelector
      ],
      default_model_storage: ModelStorage,
      train_and_preprocess: Callable[
          ..., Tuple[TrainingData, List[GraphComponent]]
      ],
  ):
      pipeline = [
          {"component": WhitespaceTokenizer},
          {
              "component": CountVectorsFeaturizer,
              "analyzer": "char_wb",
              "min_ngram": 3,
              "max_ngram": 17,
              "max_features": 10,
              "min_df": 5,
          },
      ]
  
      training_data, loaded_pipeline = train_and_preprocess(
          pipeline, "data/test_selectors"
      )
  
      config_params = {
          EPOCHS: 2,
          MODEL_CONFIDENCE: "softmax",
          CONSTRAIN_SIMILARITIES: True,
          CHECKPOINT_MODEL: True,
          EVAL_NUM_EPOCHS: 1,
          EVAL_NUM_EXAMPLES: 10,
          RUN_EAGERLY: True,
      }
  
      response_selector = create_response_selector(config_params)
      assert response_selector.component_config[CHECKPOINT_MODEL]
  
      resource = response_selector.train(training_data=training_data)
  
      with default_model_storage.read_from(resource) as model_dir:
          all_files = list(model_dir.rglob("*.*"))
          assert any(
              [
                  "from_checkpoint" in str(filename)
                  for filename in all_files
              ]
          )
  
imports: import copy
  import pytest
  import numpy
  from typing import List, Dict, Text, Any, Optional, Tuple, Union, Callable
  import rasa.model
  from rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer import CountVectorsFeaturizer
  from rasa.nlu.featurizers.sparse_featurizer.lexical_syntactic_featurizer import LexicalSyntacticFeaturizer
  from rasa.nlu.featurizers.sparse_featurizer.regex_featurizer import RegexFeaturizer
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  from rasa.engine.graph import ExecutionContext, GraphComponent
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.importers.rasa import RasaFileImporter
  from rasa.shared.nlu.training_data import util
  import rasa.shared.nlu.training_data.loading
  from rasa.utils.tensorflow.constants import EPOCHS, MASKED_LM, NUM_TRANSFORMER_LAYERS, RENORMALIZE_CONFIDENCES, TRANSFORMER_SIZE, CONSTRAIN_SIMILARITIES, CHECKPOINT_MODEL, MODEL_CONFIDENCE, RANDOM_SEED, RANKING_LENGTH, LOSS_TYPE, HIDDEN_LAYERS_SIZES, LABEL, EVAL_NUM_EXAMPLES, EVAL_NUM_EPOCHS, RUN_EAGERLY
  from rasa.shared.nlu.constants import TEXT, FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE, INTENT_RESPONSE_KEY, PREDICTED_CONFIDENCE_KEY
  from rasa.utils.tensorflow.model_data_utils import FeatureArray
  from rasa.shared.nlu.training_data.loading import load_data
  from rasa.shared.constants import DIAGNOSTIC_DATA
  from rasa.nlu.selectors.response_selector import ResponseSelector
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.nlu.constants import DEFAULT_TRANSFORMER_SIZE, RESPONSE_SELECTOR_PROPERTY_NAME, RESPONSE_SELECTOR_DEFAULT_INTENT, RESPONSE_SELECTOR_PREDICTION_KEY, RESPONSE_SELECTOR_RESPONSES_KEY
label_desc: Use image node_id 10 for calling a global function with example usage: test_train_model_checkpointing(create_response_selector, default_model_storage, train_and_preprocess) without return types