code: def iterate_minibatches(inputs, targets, batchsize, shuffle=False):
      assert len(inputs) == len(targets)
      if shuffle:
          indices = np.arange(len(inputs))
          np.random.shuffle(indices)
      for start_idx in range(0, len(inputs) - batchsize + 1, batchsize):
          if shuffle:
              excerpt = indices[start_idx : start_idx + batchsize]
          else:
              excerpt = slice(start_idx, start_idx + batchsize)
          yield inputs[excerpt], targets[excerpt]
  
file_path: Lasagne/examples/mnist.py
imports: from __future__ import print_function
  import sys
  import os
  import time
  import numpy
  import theano
  import theano.tensor
  import lasagne
label_desc: Use image node_id 5 for calling a global function with example usage: iterate_minibatches(inputs, targets, batchsize, shuffle) without return types