def _rolling_window_iter(iterator, window, step):
    """It yields lists of items with a window number of elements giving
     an iterator"""
    items = []
    for item in iterator:
        if len(items) >= window:
            yield items
            items = items[step:]
        items.append(item)
    else:
        if len(items) >= window:
            yield items
