

def autocomplete(self, input, lat_lng=None, location=None, radius=3200, language=lang.ENGLISH, types=None, components=[]):
    '\n        Perform an autocomplete search using the Google Places API.\n\n        Only the input kwarg is required, the rest of the keyword arguments\n        are optional.\n\n        keyword arguments:\n        input    -- The text string on which to search, for example:\n                    "Hattie B\'s".\n        lat_lng  -- A dict containing the following keys: lat, lng\n                    (default None)\n        location -- A human readable location, e.g \'London, England\'\n                    (default None)\n        radius   -- The radius (in meters) around the location to which the\n                    search is to be restricted. The maximum is 50000 meters.\n                    (default 3200)\n        language -- The language code, indicating in which language the\n                    results should be returned, if possible. (default lang.ENGLISH)\n        types    -- A type to search against. See `types.py` "autocomplete types"\n                    for complete list\n                    https://developers.google.com/places/documentation/autocomplete#place_types.\n        components -- An optional grouping of places to which you would\n                    like to restrict your results. An array containing one or\n                    more tuples of:\n                    * country: matches a country name or a two letter ISO 3166-1 country code.\n                    eg: [(\'country\',\'US\')]\n        '
    self._request_params = {
        'input': input,
    }
    if ((lat_lng is not None) or (location is not None)):
        lat_lng_str = self._generate_lat_lng_string(lat_lng, location)
        self._request_params['location'] = lat_lng_str
    self._request_params['radius'] = radius
    if types:
        self._request_params['types'] = types
    if (len(components) > 0):
        self._request_params['components'] = '|'.join(['{}:{}'.format(c[0], c[1]) for c in components])
    if (language is not None):
        self._request_params['language'] = language
    self._add_required_param_keys()
    (url, places_response) = _fetch_remote_json(GooglePlaces.AUTOCOMPLETE_API_URL, self._request_params)
    _validate_response(url, places_response)
    return GoogleAutocompleteSearchResult(self, places_response)

dataset/ETHPy150Open slimkrazy/python-google-places/googleplaces/__init__.py GooglePlaces.autocomplete/original