class_docstr: Geocoder using the MapQuest API based on Licensed data.
  
  Documentation at:
      https://developer.mapquest.com/documentation/geocoding-api/
  
  MapQuest provides two Geocoding APIs:
  
  - :class:`geopy.geocoders.OpenMapQuest` Nominatim-alike API
    which is based on Open data from OpenStreetMap.
  - :class:`geopy.geocoders.MapQuest` (this class) MapQuest's own API
    which is based on Licensed data.
class_docstr_tok: ["Geocoder","using","the","MapQuest","API","based","on","Licensed","data",".","Documentation","at",":","https",":","\/\/developer.mapquest.com\/documentation\/geocoding-api\/","MapQuest","provides","two","Geocoding","APIs",":","-",":","class",":","`","geopy.geocoders.OpenMapQuest","`","Nominatim-alike","API","which","is","based","on","Open","data","from","OpenStreetMap",".","-",":","class",":","`","geopy.geocoders.MapQuest","`","(","this","class",")","MapQuest","'s","own","API","which","is","based","on","Licensed","data","."]
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: Limit the maximum number of items in the
      response. This will be reset to one if ``exactly_one`` is True.
  
  :param bounds: The bounding box of the viewport within which
      to bias geocode results more prominently.
      Example: ``[Point(22, 180), Point(-22, -180)]``.
  :type bounds: list or tuple of 2 items of :class:`geopy.point.Point` or
      ``(latitude, longitude)`` or ``"%(latitude)s, %(longitude)s"``.
  
  :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",":","Limit","the","maximum","number","of","items","in","the","response",".","This","will","be","reset","to","one","if","``","exactly_one","``","is","True",".",":","param","bounds",":","The","bounding","box","of","the","viewport","within","which","to","bias","geocode","results","more","prominently",".","Example",":","``","[","Point","(","22",",","180",")",",","Point","(","-22",",","-180",")","]","``",".",":","type","bounds",":","list","or","tuple","of","2","items","of",":","class",":","`","geopy.point.Point","`","or","``","(","latitude",",","longitude",")","``","or","``","``","%","(","latitude",")","s",",","%","(","longitude",")","s","''","``",".",":","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,
      bounds=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: Limit the maximum number of items in the
          response. This will be reset to one if ``exactly_one`` is True.
  
      :param bounds: The bounding box of the viewport within which
          to bias geocode results more prominently.
          Example: ``[Point(22, 180), Point(-22, -180)]``.
      :type bounds: list or tuple of 2 items of :class:`geopy.point.Point` or
          ``(latitude, longitude)`` or ``"%(latitude)s, %(longitude)s"``.
  
      :rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
          ``exactly_one=False``.
      """
      params = {}
      params["key"] = self.api_key
      params["location"] = query
  
      if limit is not None:
          params["maxResults"] = limit
  
      if exactly_one:
          params["maxResults"] = 1
  
      if bounds:
          params["boundingBox"] = self._format_bounding_box(
              bounds, "%(lat2)s,%(lon1)s,%(lat1)s,%(lon2)s"
          )
  
      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)
  
file_path: geopy/geopy/geocoders/mapquest.py
imports: from functools import partial
  from urllib.parse import urlencode
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.util import logger
label_desc: Use image node_id 3 for calling the MapQuest obj's underlying member method code with example usage: obj.geocode(query) and returns: self