def elevation(latitude, longitude):
    """Return elevation for given latitude and longitude."""
    req = requests.get(ELEVATION_URL, params={
        'locations': '{},{}'.format(latitude, longitude),
        'sensor': 'false',
    })

    if req.status_code != 200:
        return 0

    try:
        return int(float(req.json()['results'][0]['elevation']))
    except (ValueError, __HOLE__):
        return 0
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/util/location.py/elevation