code: def generator(x, y, batch_size):
      """Creates a data generator for Keras fit_generator()."""
  
      import numpy as np
  
      samples_per_epoch = x.shape[0]
      number_of_batches = samples_per_epoch / batch_size
      counter = 0
  
      while 1:
          x_batch = np.array(
              x[batch_size * counter : batch_size * (counter + 1)]
          ).astype("float32")
          y_batch = np.array(
              y[batch_size * counter : batch_size * (counter + 1)]
          ).astype("float32")
          counter += 1
  
          yield x_batch, y_batch
  
          if counter >= number_of_batches:
              counter = 0
  
label_desc: Use image node_id 1 for calling a global function with example usage: generator(x, y, batch_size) without return types