code: def generate_batch_loader(data, batch_size):
      i = 0
      n = len(data)
  
      while i + batch_size <= n:
          yield np.asarray(data[i : i + batch_size])
          i += batch_size
  
file_path: dynet/examples/variational-autoencoder/basic-image-recon/vae.py
imports: from __future__ import print_function
  from utils import load_mnist, make_grid, pre_pillow_float_img_process, save_image
  import numpy
  import argparse
  import dynet
  import os
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: generate_batch_loader(data, batch_size) without return types