class_docstr: GeoNames geocoder.
  
  Documentation at:
      http://www.geonames.org/export/geonames-search.html
  
  Reverse geocoding documentation at:
      http://www.geonames.org/export/web-services.html#findNearbyPlaceName
class_docstr_tok: ["GeoNames","geocoder",".","Documentation","at",":","http",":","\/\/www.geonames.org\/export\/geonames-search.html","Reverse","geocoding","documentation","at",":","http",":","\/\/www.geonames.org\/export\/web-services.html","#","findNearbyPlaceName"]
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 country: Limit records to the specified countries.
      Two letter country code ISO-3166 (e.g. ``FR``). Might be
      a single string or a list of strings.
  :type country: str or list
  
  :param str country_bias: Records from the country_bias are listed first.
      Two letter country code ISO-3166.
  
  :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","country",":","Limit","records","to","the","specified","countries",".","Two","letter","country","code","ISO-3166","(","e.g",".","``","FR","``",")",".","Might","be","a","single","string","or","a","list","of","strings",".",":","type","country",":","str","or","list",":","param","str","country_bias",":","Records","from","the","country_bias","are","listed","first",".","Two","letter","country","code","ISO-3166",".",":","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,
      country=None,
      country_bias=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 country: Limit records to the specified countries.
          Two letter country code ISO-3166 (e.g. ``FR``). Might be
          a single string or a list of strings.
      :type country: str or list
  
      :param str country_bias: Records from the country_bias are listed first.
          Two letter country code ISO-3166.
  
      :rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
          ``exactly_one=False``.
      """
      params = [
          ("q", query),
          ("username", self.username),
      ]
  
      if country_bias:
          params.append(("countryBias", country_bias))
  
      if not country:
          country = []
      if isinstance(country, str):
          country = [country]
      for country_item in country:
          params.append(("country", country_item))
  
      if exactly_one:
          params.append(("maxRows", 1))
      url = "?".join((self.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)
  
file_path: geopy/geopy/geocoders/geonames.py
imports: from functools import partial
  from urllib.parse import urlencode
  from geopy.exc import GeocoderAuthenticationFailure, GeocoderInsufficientPrivileges, GeocoderQueryError, GeocoderQuotaExceeded, GeocoderServiceError
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.timezone import ensure_pytz_is_installed, from_fixed_gmt_offset, from_timezone_name
  from geopy.util import logger
label_desc: Use image node_id 2 for calling the GeoNames obj's underlying member method code with example usage: obj.geocode(query) and returns: self