class_docstr: What3Words geocoder using the legacy V2 API.
  
  Documentation at:
      https://docs.what3words.com/api/v2/
  
  .. attention::
      Consider using :class:`.What3WordsV3` instead.
docstr: Return a location point for a `3 words` query. If the `3 words` address
  doesn't exist, a :class:`geopy.exc.GeocoderQueryError` exception will be
  thrown.
  
  :param str query: The 3-word address you wish to geocode.
  
  :param str lang: two character language code as supported by
      the API (https://docs.what3words.com/api/v2/#lang).
  
  :param bool exactly_one: Return one result or a list of results, if
      available. Due to the address scheme there is always exactly one
      result for each `3 words` address, so this parameter is rather
      useless for this geocoder.
  
  :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.
  
  :rtype: :class:`geopy.location.Location` or a list of them, if
      ``exactly_one=False``.
docstr_tok: ["Return","a","location","point","for","a","`","3","words","`","query",".","If","the","`","3","words","`","address","does","n't","exist",",","a",":","class",":","`","geopy.exc.GeocoderQueryError","`","exception","will","be","thrown",".",":","param","str","query",":","The","3-word","address","you","wish","to","geocode",".",":","param","str","lang",":","two","character","language","code","as","supported","by","the","API","(","https",":","\/\/docs.what3words.com\/api\/v2\/","#","lang",")",".",":","param","bool","exactly_one",":","Return","one","result","or","a","list","of","results",",","if","available",".","Due","to","the","address","scheme","there","is","always","exactly","one","result","for","each","`","3","words","`","address",",","so","this","parameter","is","rather","useless","for","this","geocoder",".",":","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",".",":","rtype",":",":","class",":","`","geopy.location.Location","`","or","a","list","of","them",",","if","``","exactly_one=False","``","."]
code: def geocode(
      self,
      query,
      *,
      lang="en",
      exactly_one=True,
      timeout=DEFAULT_SENTINEL,
  ):
      """
      Return a location point for a `3 words` query. If the `3 words` address
      doesn't exist, a :class:`geopy.exc.GeocoderQueryError` exception will be
      thrown.
  
      :param str query: The 3-word address you wish to geocode.
  
      :param str lang: two character language code as supported by
          the API (https://docs.what3words.com/api/v2/#lang).
  
      :param bool exactly_one: Return one result or a list of results, if
          available. Due to the address scheme there is always exactly one
          result for each `3 words` address, so this parameter is rather
          useless for this geocoder.
  
      :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.
  
      :rtype: :class:`geopy.location.Location` or a list of them, if
          ``exactly_one=False``.
      """
  
      if not _check_query(query):
          raise exc.GeocoderQueryError(
              "Search string must be 'word.word.word'"
          )
  
      params = {
          "addr": query,
          "lang": lang.lower(),
          "key": self.api_key,
      }
  
      url = "?".join((self.geocode_api, 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)
  
imports: import re
  from functools import partial
  from urllib.parse import urlencode
  from geopy import exc
  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 What3Words obj's underlying member method code with example usage: obj.geocode(query) and returns: self