class_docstr: TomTom geocoder.
  
  Documentation at:
      https://developer.tomtom.com/search-api/search-api-documentation
class_docstr_tok: ["TomTom","geocoder",".","Documentation","at",":","https",":","\/\/developer.tomtom.com\/search-api\/search-api-documentation"]
docstr: Return a location point by address.
  
  :param str query: The address or query you wish to geocode.
  
  :param bool exactly_one: Return one result or a list of results, if
      available.
  
  :param int timeout: Time, in seconds, to wait for the geocoding service
      to respond before raising a :class:`geopy.exc.GeocoderTimedOut`
      exception. Set this only if you wish to override, on this call
      only, the value set during the geocoder's initialization.
  
  :param int limit: Maximum amount of results to return from the service.
      Unless exactly_one is set to False, limit will always be 1.
  
  :param bool typeahead: If the "typeahead" flag is set, the query
      will be interpreted as a partial input and the search will
      enter predictive mode.
  
  :param str language: Language in which search results should be
      returned. When data in specified language is not
      available for a specific field, default language is used.
      List of supported languages (case-insensitive):
      https://developer.tomtom.com/online-search/online-search-documentation/supported-languages
  
  :rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
      ``exactly_one=False``.
docstr_tok: ["Return","a","location","point","by","address",".",":","param","str","query",":","The","address","or","query","you","wish","to","geocode",".",":","param","bool","exactly_one",":","Return","one","result","or","a","list","of","results",",","if","available",".",":","param","int","timeout",":","Time",",","in","seconds",",","to","wait","for","the","geocoding","service","to","respond","before","raising","a",":","class",":","`","geopy.exc.GeocoderTimedOut","`","exception",".","Set","this","only","if","you","wish","to","override",",","on","this","call","only",",","the","value","set","during","the","geocoder","'s","initialization",".",":","param","int","limit",":","Maximum","amount","of","results","to","return","from","the","service",".","Unless","exactly_one","is","set","to","False",",","limit","will","always","be","1.",":","param","bool","typeahead",":","If","the","``","typeahead","''","flag","is","set",",","the","query","will","be","interpreted","as","a","partial","input","and","the","search","will","enter","predictive","mode",".",":","param","str","language",":","Language","in","which","search","results","should","be","returned",".","When","data","in","specified","language","is","not","available","for","a","specific","field",",","default","language","is","used",".","List","of","supported","languages","(","case-insensitive",")",":","https",":","\/\/developer.tomtom.com\/online-search\/online-search-documentation\/supported-languages",":","rtype",":","``","None","``",",",":","class",":","`","geopy.location.Location","`","or","a","list","of","them",",","if","``","exactly_one=False","``","."]
code: def geocode(
      self,
      query,
      *,
      exactly_one=True,
      timeout=DEFAULT_SENTINEL,
      limit=None,
      typeahead=False,
      language=None,
  ):
      """
      Return a location point by address.
  
      :param str query: The address or query you wish to geocode.
  
      :param bool exactly_one: Return one result or a list of results, if
          available.
  
      :param int timeout: Time, in seconds, to wait for the geocoding service
          to respond before raising a :class:`geopy.exc.GeocoderTimedOut`
          exception. Set this only if you wish to override, on this call
          only, the value set during the geocoder's initialization.
  
      :param int limit: Maximum amount of results to return from the service.
          Unless exactly_one is set to False, limit will always be 1.
  
      :param bool typeahead: If the "typeahead" flag is set, the query
          will be interpreted as a partial input and the search will
          enter predictive mode.
  
      :param str language: Language in which search results should be
          returned. When data in specified language is not
          available for a specific field, default language is used.
          List of supported languages (case-insensitive):
          https://developer.tomtom.com/online-search/online-search-documentation/supported-languages
  
      :rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
          ``exactly_one=False``.
      """
      params = self._geocode_params(query)
      params["typeahead"] = self._boolean_value(typeahead)
  
      if limit:
          params["limit"] = str(int(limit))
      if exactly_one:
          params["limit"] = "1"
  
      if language:
          params["language"] = language
  
      quoted_query = quote(query.encode("utf-8"))
      url = "?".join(
          (self.api % dict(query=quoted_query), urlencode(params))
      )
      logger.debug("%s.geocode: %s", self.__class__.__name__, url)
      callback = partial(self._parse_json, exactly_one=exactly_one)
      return self._call_geocoder(url, callback, timeout=timeout)
  
file_path: geopy/geopy/geocoders/tomtom.py
imports: from functools import partial
  from urllib.parse import quote, urlencode
  from geopy.adapters import AdapterHTTPError
  from geopy.exc import GeocoderQuotaExceeded
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.util import logger
label_desc: Use image node_id 2 for calling the TomTom obj's underlying member method code with example usage: obj.geocode(query) and returns: self