@cache(seconds=86400)
def check_api_key(key):
    print "Trying apikey '%s'" % (key)
    try:
        urllib2.urlopen("http://transparencydata.com/api/1.0/entities/id_lookup.json?bioguide_id=0&apikey=%s" % key).read()
        return True
    except urllib2.HTTPError as e:
        if e.code == 401:
            return None
        else:
            raise
dataset/ETHPy150Open sunlightlabs/read_FEC/fecreader/api/middleware.py/check_api_key/original