code: def generator(arrays, batch_size):
      """Generate batches, one with respect to each array's first axis."""
      starts = [0] * len(
          arrays
      )  # pointers to where we are in iteration
      while True:
          batches = []
          for i, array in enumerate(arrays):
              start = starts[i]
              stop = start + batch_size
              diff = stop - array.shape[0]
              if diff <= 0:
                  batch = array[start:stop]
                  starts[i] += batch_size
              else:
                  batch = np.concatenate((array[start:], array[:diff]))
                  starts[i] = diff
              batches.append(batch)
          yield batches
  
file_path: edward/examples/bayesian_linear_regression_implicitklqp.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import tensorflow
  from edward.models import Normal
label_desc: Use image node_id 2 for calling a global function with example usage: generator(arrays, batch_size) without return types