def lookup(name):
    if(name is None or len(name) == 0):
        return None

    key = get_key()

    try:
        params = {'format': 'json', 'key': key, 'location': name}
        if(constants.debug is True):
            print 'http://open.mapquestapi.com/geocoding/v1/address?%s' % urllib.urlencode(params)  # noqa
        r = requests.get(
            'http://open.mapquestapi.com/geocoding/v1/address?%s' %
            urllib.urlencode(params)
        )
        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/lookup