class_docstr: This class implements the mixup algorithm [1] for natural language processing.
  
  [1] Zhang, Hongyi, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. "mixup: Beyond empirical risk
  minimization." in International Conference on Learning Representations (2018).
  https://openreview.net/forum?id=r1Ddp1-Rb
docstr: This function implements the batch iterator and specifically calls mixup
  
  :param data: Input data. Numpy ndarray or list of lists.
  :param labels: Labels. Numpy ndarray or list of lists.
  :param batch_size: Int (default: 32).
  :param shuffle: Boolean (default: True).
  :param runs: Int (default: 1). Number of augmentations
  
  :rtype:   array or tuple
  :return:  array or tuple of arrays (X_data array, labels array).
docstr_tok: ["This","function","implements","the","batch","iterator","and","specifically","calls","mixup",":","param","data",":","Input","data",".","Numpy","ndarray","or","list","of","lists",".",":","param","labels",":","Labels",".","Numpy","ndarray","or","list","of","lists",".",":","param","batch_size",":","Int","(","default",":","32",")",".",":","param","shuffle",":","Boolean","(","default",":","True",")",".",":","param","runs",":","Int","(","default",":","1",")",".","Number","of","augmentations",":","rtype",":","array","or","tuple",":","return",":","array","or","tuple","of","arrays","(","X_data","array",",","labels","array",")","."]
code: def flow(
      self, data, labels=None, batch_size=32, shuffle=True, runs=1
  ):
      """This function implements the batch iterator and specifically calls mixup
  
      :param data: Input data. Numpy ndarray or list of lists.
      :param labels: Labels. Numpy ndarray or list of lists.
      :param batch_size: Int (default: 32).
      :param shuffle: Boolean (default: True).
      :param runs: Int (default: 1). Number of augmentations
  
      :rtype:   array or tuple
      :return:  array or tuple of arrays (X_data array, labels array).
      """
  
      self.validate(
          data=data,
          labels=labels,
          batch_size=batch_size,
          shuffle=shuffle,
          runs=runs,
      )
  
      self.runs = runs
  
      num_batches_per_epoch = int((len(data) - 1) / batch_size) + 1
  
      def data_generator():
          data_size = len(data)
          while True:
              # Shuffle the data at each epoch
              if shuffle:
                  shuffle_indices = np.random.permutation(
                      np.arange(data_size)
                  )
                  shuffled_data = data[shuffle_indices]
                  if labels is not None:
                      shuffled_labels = labels[shuffle_indices]
              else:
                  shuffled_data = data
                  if labels is not None:
                      shuffled_labels = labels
              for batch_num in range(num_batches_per_epoch):
                  start_index = batch_num * batch_size
                  end_index = min(
                      (batch_num + 1) * batch_size, data_size
                  )
                  X = shuffled_data[start_index:end_index]
                  if labels is None:
                      X = self.mixup_data(X, y=None)
                      yield X
                  else:
                      y = shuffled_labels[start_index:end_index]
                      X, y = self.mixup_data(X, y)
                      yield X, y
  
      return data_generator(), num_batches_per_epoch
  
imports: import numpy
  import random
label_desc: Use image node_id 4 for calling the MIXUP obj's underlying member method code with example usage: obj.flow(data, labels, batch_size, shuffle, runs) and returns: data_generator,  num_batches_per_epoch