def delay(iterator, wait = 1, every = 1):
    """
    Delays between every n images for the specified time. Useful so that Flickr
    doesn't disable your API key for excessive usage.
    """
    for i, photo in enumerate(iterator):
        if i > 0 and i % every == 0:
            time.sleep(wait)
        yield photo
dataset/ETHPy150Open cvondrick/pyvision/vision/flickr.py/delay/original