def filtersizes(iterator, size = "medium"):
    """
    Filters sizes from the iterator and only returns images that are the
    specified minimum size.

    By default, it filters out all the small images. To download only
    originals, pass "original". Valid sizes are:
        - small
        - medium
        - large
        - original
    """
    sizes = {"small": 0, "medium": 1, "large": 2, "original": 3}
    required = sizes[size]
    for x in iterator:
        if x.format in sizes and sizes[x.format] >= required:
            yield x
dataset/ETHPy150Open cvondrick/pyvision/vision/flickr.py/filtersizes/original