code: def create_data_generators(
      model_data: RasaModelData,
      batch_sizes: Union[int, List[int]],
      epochs: int,
      batch_strategy: Text = SEQUENCE,
      eval_num_examples: int = 0,
      random_seed: Optional[int] = None,
      shuffle: bool = True,
  ) -> Tuple[RasaBatchDataGenerator, Optional[RasaBatchDataGenerator]]:
      """Create data generators for train and optional validation data.
  
      Args:
          model_data: The model data to use.
          batch_sizes: The batch size(s).
          epochs: The number of epochs to train.
          batch_strategy: The batch strategy to use.
          eval_num_examples: Number of examples to use for validation data.
          random_seed: The random seed.
          shuffle: Whether to shuffle data inside the data generator.
  
      Returns:
          The training data generator and optional validation data generator.
      """
      validation_data_generator = None
      if eval_num_examples > 0:
          model_data, evaluation_model_data = model_data.split(
              eval_num_examples, random_seed
          )
          validation_data_generator = RasaBatchDataGenerator(
              evaluation_model_data,
              batch_size=batch_sizes,
              epochs=epochs,
              batch_strategy=batch_strategy,
              shuffle=shuffle,
          )
  
      data_generator = RasaBatchDataGenerator(
          model_data,
          batch_size=batch_sizes,
          epochs=epochs,
          batch_strategy=batch_strategy,
          shuffle=shuffle,
      )
  
      return data_generator, validation_data_generator
  
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 10 for calling a global function with example usage: create_data_generators(model_data, batch_sizes, epochs, batch_strategy, eval_num_examples, random_seed, shuffle) and returns: data_generator,  validation_data_generator