code: def _check_confidence_setting(
      component_config: Dict[Text, Any]
  ) -> None:
      if component_config[MODEL_CONFIDENCE] == COSINE:
          raise InvalidConfigException(
              f"{MODEL_CONFIDENCE}={COSINE} was introduced in Rasa Open Source 2.3.0 "
              f"but post-release experiments revealed that using cosine similarity can "
              f"change the order of predicted labels. "
              f"Since this is not ideal, using `{MODEL_CONFIDENCE}={COSINE}` has been "
              f"removed in versions post `2.3.3`. "
              f"Please use `{MODEL_CONFIDENCE}={SOFTMAX}` instead."
          )
      if component_config[MODEL_CONFIDENCE] == INNER:
          raise InvalidConfigException(
              f"{MODEL_CONFIDENCE}={INNER} is deprecated as it produces an unbounded "
              f"range of confidences which can break the logic of assistants in various "
              f"other places. "
              f"Please use `{MODEL_CONFIDENCE}={SOFTMAX}` instead. "
          )
      if component_config[MODEL_CONFIDENCE] not in [SOFTMAX, AUTO]:
          raise InvalidConfigException(
              f"{MODEL_CONFIDENCE}={component_config[MODEL_CONFIDENCE]} is not a valid "
              f"setting. Please use `{MODEL_CONFIDENCE}={SOFTMAX}` instead."
          )
      if component_config[MODEL_CONFIDENCE] == SOFTMAX:
          if component_config[LOSS_TYPE] != CROSS_ENTROPY:
              raise InvalidConfigException(
                  f"{LOSS_TYPE}={component_config[LOSS_TYPE]} and "
                  f"{MODEL_CONFIDENCE}={SOFTMAX} is not a valid "
                  f"combination. You can use {MODEL_CONFIDENCE}={SOFTMAX} "
                  f"only with {LOSS_TYPE}={CROSS_ENTROPY}."
              )
          if component_config[SIMILARITY_TYPE] not in [INNER, AUTO]:
              raise InvalidConfigException(
                  f"{SIMILARITY_TYPE}={component_config[SIMILARITY_TYPE]} and "
                  f"{MODEL_CONFIDENCE}={SOFTMAX} is not a valid "
                  f"combination. You can use {MODEL_CONFIDENCE}={SOFTMAX} "
                  f"only with {SIMILARITY_TYPE}={INNER}."
              )
      if component_config.get(
          RENORMALIZE_CONFIDENCES
      ) and component_config.get(RANKING_LENGTH):
          if component_config[MODEL_CONFIDENCE] != SOFTMAX:
              raise InvalidConfigException(
                  f"Renormalizing the {component_config[RANKING_LENGTH]} top "
                  f"predictions should only be done if {MODEL_CONFIDENCE}={SOFTMAX} "
                  f"Please use {RENORMALIZE_CONFIDENCES}={True} "
                  f"only with {MODEL_CONFIDENCE}={SOFTMAX}."
              )
  
imports: from pathlib import Path
  import numpy
  from typing import Optional, Text, Dict, Any, Union, List, Tuple, TYPE_CHECKING
  import rasa.shared.utils.common
  import rasa.shared.utils.io
  import rasa.nlu.utils.bilou_utils
  from rasa.shared.constants import NEXT_MAJOR_VERSION_FOR_DEPRECATIONS
  from rasa.nlu.constants import NUMBER_OF_SUB_TOKENS
  import rasa.utils.io
  from rasa.utils.tensorflow.constants import LOSS_TYPE, RANKING_LENGTH, RENORMALIZE_CONFIDENCES, SIMILARITY_TYPE, EVAL_NUM_EXAMPLES, EVAL_NUM_EPOCHS, EPOCHS, SOFTMAX, MARGIN, AUTO, INNER, COSINE, SEQUENCE, CROSS_ENTROPY, CONSTRAIN_SIMILARITIES, MODEL_CONFIDENCE, TOLERANCE, CHECKPOINT_MODEL
  from rasa.utils.tensorflow.callback import RasaTrainingLogger, RasaModelCheckpoint
  from rasa.utils.tensorflow.data_generator import RasaBatchDataGenerator
  from rasa.utils.tensorflow.model_data import RasaModelData
  from rasa.shared.nlu.constants import SPLIT_ENTITIES_BY_COMMA
  from rasa.shared.exceptions import InvalidConfigException
label_desc: Use image node_id 16 for calling a global function with example usage: _check_confidence_setting(component_config) without return types