

def search(tags, perpage=100):
    '\n    Builds an iterator for all the photos returned by a Flickr search. This\n    function automatically jumps to the next page when a page is exhausted.\n    '
    (page, pages) = (1, 2)
    while (page < photos):
        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/VarMisuse@32/96 `pages`->`photos`