def search(tags, perpage = 100):
    """
    Builds an iterator for all the photos returned by a Flickr search. This
    function automatically jumps to the next page when a page is exhausted.
    """
    page, pages = 1, 2
    while page < pages:
        photos = request("flickr.photos.search", {
            "tags": tags,
            "page": page,
            "per_page": perpage,
            "extras": all_extras})
        photos = photos.find("photos")
        pages = int(photos.get("pages"))
        page += 1
        for photo in photos:
            yield Photo.fromapi(photo.attrib)
dataset/ETHPy150Open cvondrick/pyvision/vision/flickr.py/search/original