def METHOD_NAME(token, repo):
    headers = {'Authorization': 'token %s' % token}
    url = PULL_API % repo
    prs = []
    while True:
        logging.info('fetching %s', url)
        response = urlfetch.fetch(url, headers=headers)
        if response.status_code == 404:
            logging.warning('repo was deleted?')
            # Returning no open PRs will make us fake a close event for each of
            # them, which is appropriate.
            return []
        if response.status_code != 200:
            raise urlfetch.Error('status code %s' % response.status_code)
        prs += json.loads(response.content)
        m = re.search(r'<([^>]+)>; rel="next"', response.headers.get('Link', ''))
        if m:
            url = m.group(1)
        else:
            break
    logging.info('pr count: %d, github tokens left: %s',
                 len(prs), response.headers.get('x-ratelimit-remaining'))
    return prs