def nearby_search(self, language=lang.ENGLISH, keyword=None, location=None,<EOL>lat_lng=None, name=None, radius=<NUM_LIT>, rankby=ranking.PROMINENCE,<EOL>sensor=False, type=None, types=[], pagetoken=None):
if location is None and lat_lng is None and pagetoken is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if rankby == '<STR_LIT>':<EOL><INDENT>if keyword is None and types == [] and name is None:<EOL><INDENT>raise ValueError('<STR_LIT>' +<EOL>'<STR_LIT>' +<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>self._sensor = sensor<EOL>radius = (radius if radius <= GooglePlaces.MAXIMUM_SEARCH_RADIUS<EOL>else GooglePlaces.MAXIMUM_SEARCH_RADIUS)<EOL>lat_lng_str = self._generate_lat_lng_string(lat_lng, location)<EOL>self._request_params = {'<STR_LIT:location>': lat_lng_str}<EOL>if rankby == '<STR_LIT>':<EOL><INDENT>self._request_params['<STR_LIT>'] = radius<EOL><DEDENT>else:<EOL><INDENT>self._request_params['<STR_LIT>'] = rankby<EOL><DEDENT>if type:<EOL><INDENT>self._request_params['<STR_LIT:type>'] = type<EOL><DEDENT>elif types:<EOL><INDENT>if len(types) == <NUM_LIT:1>:<EOL><INDENT>self._request_params['<STR_LIT:type>'] = types[<NUM_LIT:0>]<EOL><DEDENT>elif len(types) > <NUM_LIT:1>:<EOL><INDENT>self._request_params['<STR_LIT>'] = '<STR_LIT:|>'.join(types)<EOL><DEDENT><DEDENT>if keyword is not None:<EOL><INDENT>self._request_params['<STR_LIT>'] = keyword<EOL><DEDENT>if name is not None:<EOL><INDENT>self._request_params['<STR_LIT:name>'] = name<EOL><DEDENT>if pagetoken is not None:<EOL><INDENT>self._request_params['<STR_LIT>'] = pagetoken<EOL><DEDENT>if language is not None:<EOL><INDENT>self._request_params['<STR_LIT>'] = language<EOL><DEDENT>self._add_required_param_keys()<EOL>url, places_response = _fetch_remote_json(<EOL>GooglePlaces.NEARBY_SEARCH_API_URL, self._request_params)<EOL>_validate_response(url, places_response)<EOL>return GooglePlacesSearchResult(self, places_response)<EOL>
Perform a nearby search using the Google Places API.

        One of either location, lat_lng or pagetoken are required, the rest of 
        the keyword arguments are optional.

        keyword arguments:
        keyword  -- A term to be matched against all available fields, including
                    but not limited to name, type, and address (default None)
        location -- A human readable location, e.g 'London, England'
                    (default None)
        language -- The language code, indicating in which language the
                    results should be returned, if possible. (default lang.ENGLISH)
        lat_lng  -- A dict containing the following keys: lat, lng
                    (default None)
        name     -- A term to be matched against the names of the Places.
                    Results will be restricted to those containing the passed
                    name value. (default None)
        radius   -- The radius (in meters) around the location/lat_lng to
                    restrict the search to. The maximum is 50000 meters.
                    (default 3200)
        rankby   -- Specifies the order in which results are listed :
                    ranking.PROMINENCE (default) or ranking.DISTANCE
                    (imply no radius argument).
        sensor   -- Indicates whether or not the Place request came from a
                    device using a location sensor (default False).
        type     -- Optional type param used to indicate place category.
        types    -- An optional list of types, restricting the results to
                    Places (default []). If there is only one item the request
                    will be send as type param.
        pagetoken-- Optional parameter to force the search result to return the next
                    20 results from a previously run search. Setting this parameter 
                    will execute a search with the same parameters used previously. 
                    (default None)