def reverse_lookup(lat, lon):
    if(lat is None or lon is None):
        return None

    key = get_key()

    try:
        params = {'format': 'json', 'key': key, 'lat': lat, 'lon': lon}
        headers = {"Accept-Language": constants.accepted_language}
        r = requests.get(
            'http://open.mapquestapi.com/nominatim/v1/reverse.php?%s' %
            urllib.urlencode(params), headers=headers
        )
        return r.json()
    except requests.exceptions.RequestException as e:
        if(constants.debug is True):
            print e
        return None
    except __HOLE__ as e:
        if(constants.debug is True):
            print r.text
            print e
        return None
dataset/ETHPy150Open jmathai/elodie/elodie/geolocation.py/reverse_lookup