<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def geocode_location(location, sensor=False, api_key=None):
 """Converts a human-readable location to lat-lng. Returns a dict with lat and lng keys. keyword arguments: location -- A human-readable location, e.g 'London, England' sensor -- Boolean flag denoting if the location came from a device using its' location sensor (default False) api_key -- A valid Google Places API key. raises: GooglePlacesError -- if the geocoder fails to find a location. """

    params = {'address': location, 'sensor': str(sensor).lower()}
    if api_key is not None:
        params['key'] = api_key
    url, geo_response = _fetch_remote_json(
            GooglePlaces.GEOCODE_API_URL, params)
    _validate_response(url, geo_response)
    if geo_response['status'] == GooglePlaces.RESPONSE_STATUS_ZERO_RESULTS:
        error_detail = ('Lat/Lng for location \'%s\' can\'t be determined.' %
                        location)
        raise GooglePlacesError(error_detail)
    return geo_response['results'][0]['geometry']['location']