code: def data_generator(x_full, y_full, bs):
      def split(arr, size):
          arrays = []
          while len(arr) > size:
              slice_ = arr[:size]
              arrays.append(slice_)
              arr = arr[size:]
          arrays.append(arr)
          return arrays
  
      while True:
          for rr in split((x_full, y_full), bs):
              yield rr
  
imports: import numpy
  import pandas
  from numpy import matrix
  from scipy import linalg
  from matplotlib.pylab import rcParams
label_desc: Use image node_id 2 for calling a global function with example usage: data_generator(x_full, y_full, bs) and returns: arrays