code: def batches(*xss, **kwargs):
      """Iterate over subsets of lists of examples.
  
      Yields batches of the form `[xs[indices] for xs in xss]` where at each
      iteration `indices` selects a subset. Each index is only selected once.
      **kwargs could be one of the following:
        size: number of elements per batch
        discard_remainder: if true, discard final short batch
        shuffle: if true, yield examples in randomly determined order
        shuffle_rng: seed or rng to determine random order
  
      Args:
        *xss: lists of elements to batch
        **kwargs: kwargs could be one of the above.
  
  
      Yields:
        A batch of the same structure as `xss`, but with `size` examples.
      """
      size = kwargs.get("size", 1)
      discard_remainder = kwargs.get("discard_remainder", True)
      shuffle = kwargs.get("shuffle", False)
      shuffle_rng = kwargs.get("shuffle_rng", None)
  
      shuffle_rng = get_rng(shuffle_rng)
      n = int(np.unique(list(map(len, xss))))
      assert all(len(xs) == len(xss[0]) for xs in xss)
      indices = np.arange(len(xss[0]))
      if shuffle:
          np.random.shuffle(indices)
      for start in range(0, n, size):
          batch_indices = indices[start : start + size]
          if len(batch_indices) < size and discard_remainder:
              break
          batch_xss = [xs[batch_indices] for xs in xss]
          yield batch_xss
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import datetime
  import numbers
  import pdb
  import tempfile
  import time
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 12 for calling a global function with example usage: batches() without return types