def create_repeated_indexes(data):
    """
    Convenience function. Given an array-like with length N,
    returns a generator that yields N indexes [0, 1, ..., N].
    """
    from numpy import arange
    index_range = arange(0, len(data))
    return (index_range for i in index_range)
