code: def batch_iterator(X, y=None, batch_size=64):
      """Simple batch generator"""
      n_samples = X.shape[0]
      for i in np.arange(0, n_samples, batch_size):
          begin, end = i, min(i + batch_size, n_samples)
          if y is not None:
              yield X[begin:end], y[begin:end]
          else:
              yield X[begin:end]
  
file_path: ML-From-Scratch/mlfromscratch/utils/data_manipulation.py
imports: from __future__ import division
  from itertools import combinations_with_replacement
  import numpy
  import math
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: batch_iterator(X, y, batch_size) without return types