code: def test_data_generator_with_fixed_batch_size(
      model_data: RasaModelData,
  ):
      data_generator = RasaBatchDataGenerator(
          model_data,
          batch_size=2,
          epochs=1,
          batch_strategy="balanced",
          shuffle=True,
      )
  
      expected_batch_sizes = [2, 2, 1]
  
      iterator = iter(data_generator)
  
      assert len(data_generator) == len(expected_batch_sizes)
  
      for i in range(len(data_generator)):
          batch, _ = next(iterator)
          assert len(batch) == 11
          assert len(batch[0]) == expected_batch_sizes[i]
  
      with pytest.raises(StopIteration):
          next(iterator)
  
file_path: rasa/tests/utils/tensorflow/test_data_generator.py
imports: import pytest
  import scipy.sparse
  import numpy
  from rasa.utils.tensorflow.model_data import ragged_array_to_ndarray, FeatureArray, RasaModelData
  from rasa.utils.tensorflow.data_generator import RasaDataGenerator, RasaBatchDataGenerator
label_desc: Use image node_id 2 for calling a global function with example usage: test_data_generator_with_fixed_batch_size(model_data) without return types