def iter_minibatches(lst, batch_size, dims, n_cycles=False, random_state=None):
    """Return an iterator that successively yields tuples containing aligned
    minibatches of size `batch_size` from slicable objects given in `lst`, in
    random order without replacement.

    Because different containers might require slicing over different
    dimensions, the dimension of each container has to be givens as a list
    `dims`.


    Parameters
    ----------

    lst : list of array_like
        Each item of the list will be sliced into mini batches in alignemnt with
        the others.

    batch_size : int
        Size of each batch. Last batch might be smaller.

    dims : list
        Aligned with ``lst``, gives the dimension along which the data samples
        are separated.

    n_cycles : int or False, optional [default: False]
        Number of cycles after which to stop the iterator. If ``False``, will
        yield forever.

    random_state : a numpy.random.RandomState object, optional [default : None]
        Random number generator that will act as a seed for the minibatch order


    Returns
    -------

    batches : iterator
        Infinite iterator of mini batches in random order (without
        replacement).
    """
    batches = [minibatches(i, batch_size, d) for i, d in zip(lst, dims)]
    if len(batches) > 1:
        if any(len(i) != len(batches[0]) for i in batches[1:]):
            raise ValueError("containers to be batched have different lengths")
    counter = itertools.count()
    if random_state is not None:
        random.seed(random_state.normal())
    while True:
        indices = [i for i, _ in enumerate(batches[0])]
        while True:
            random.shuffle(indices)
            for i in indices:
                yield tuple(b[i] for b in batches)
            count = next(counter)
            if n_cycles and n_cycles >= count:
                raise StopIteration()
dataset/ETHPy150Open BRML/climin/climin/util.py/iter_minibatches/swapped operands of `>=`