code: def test_raise_exception_decreased_sparse_feature_sizes(
      new_sparse_feature_sizes: Dict[Text, Dict[Text, List[int]]],
      old_sparse_feature_sizes: Dict[Text, Dict[Text, List[int]]],
      raise_exception: bool,
  ):
      """Tests if exception is raised when sparse feature sizes decrease
      during incremental training."""
      if raise_exception:
          with pytest.raises(Exception) as exec_info:
              TransformerRasaModel._check_if_sparse_feature_sizes_decreased(
                  new_sparse_feature_sizes=new_sparse_feature_sizes,
                  old_sparse_feature_sizes=old_sparse_feature_sizes,
              )
          assert "Sparse feature sizes have decreased" in str(
              exec_info.value
          )
      else:
          TransformerRasaModel._check_if_sparse_feature_sizes_decreased(
              new_sparse_feature_sizes=new_sparse_feature_sizes,
              old_sparse_feature_sizes=old_sparse_feature_sizes,
          )
  
file_path: rasa/tests/utils/tensorflow/test_models.py
imports: import pytest
  from typing import Dict, Text, Union, Tuple, List
  import numpy
  import tensorflow
  from rasa.utils.tensorflow.models import RasaModel, TransformerRasaModel
  from rasa.utils.tensorflow.model_data import RasaModelData
  from rasa.utils.tensorflow.model_data import FeatureArray
  from rasa.utils.tensorflow.constants import LABEL, IDS, SENTENCE
  from rasa.shared.nlu.constants import TEXT, FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE
label_desc: Use image node_id 3 for calling a global function with example usage: test_raise_exception_decreased_sparse_feature_sizes(new_sparse_feature_sizes, old_sparse_feature_sizes, raise_exception) without return types