code: def test_sets_integer_transformer_size_when_needed(
      config: Dict[Text, Optional[int]],
      should_set_default_transformer_size: bool,
      create_response_selector: Callable[
          [Dict[Text, Any]], ResponseSelector
      ],
  ):
      """ResponseSelector ensures sensible transformer size when transformer enabled."""
      with pytest.warns(UserWarning) as records:
          selector = create_response_selector(config)
  
      warning_str = f"positive size is required when using `{NUM_TRANSFORMER_LAYERS} > 0`"
  
      if should_set_default_transformer_size:
          assert len(records) > 0
          # check that the specific warning was raised
          assert any(
              warning_str in record.message.args[0]
              for record in records
          )
          # check that transformer size got set to the new default
          assert (
              selector.component_config[TRANSFORMER_SIZE]
              == DEFAULT_TRANSFORMER_SIZE
          )
      else:
          # check that the specific warning was not raised
          assert not any(
              warning_str in record.message.args[0]
              for record in records
          )
          # check that transformer size was not changed
          assert selector.component_config[
              TRANSFORMER_SIZE
          ] == config.get(
              TRANSFORMER_SIZE,
              None,  # None is the default transformer size
          )
  
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 13 for calling a global function with example usage: test_sets_integer_transformer_size_when_needed(config, should_set_default_transformer_size, create_response_selector) without return types