class_docstr: Geocoder using the Mapbox API.
  
  Documentation at:
      https://www.mapbox.com/api-documentation/
class_docstr_tok: ["Geocoder","using","the","Mapbox","API",".","Documentation","at",":","https",":","\/\/www.mapbox.com\/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 proximity: A coordinate to bias local results based on a provided
      location.
  :type proximity: :class:`geopy.point.Point`, list or tuple of ``(latitude,
      longitude)``, or string as ``"%(latitude)s, %(longitude)s"``.
  
  :param country: Country to filter result in form of
      ISO 3166-1 alpha-2 country code (e.g. ``FR``).
      Might be a Python list of strings.
  
  :type country: str or list
  
  :param str language: This parameter controls the language of the text supplied in
      responses, and also affects result scoring, with results matching the user’s
      query in the requested language being preferred over results that match in
      another language. You can pass two letters country codes (ISO 639-1).
  
      .. versionadded:: 2.3
  
  :param bbox: The bounding box of the viewport within which
      to bias geocode results more prominently.
      Example: ``[Point(22, 180), Point(-22, -180)]``.
  :type bbox: 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","proximity",":","A","coordinate","to","bias","local","results","based","on","a","provided","location",".",":","type","proximity",":",":","class",":","`","geopy.point.Point","`",",","list","or","tuple","of","``","(","latitude",",","longitude",")","``",",","or","string","as","``","``","%","(","latitude",")","s",",","%","(","longitude",")","s","''","``",".",":","param","country",":","Country","to","filter","result","in","form","of","ISO","3166-1","alpha-2","country","code","(","e.g",".","``","FR","``",")",".","Might","be","a","Python","list","of","strings",".",":","type","country",":","str","or","list",":","param","str","language",":","This","parameter","controls","the","language","of","the","text","supplied","in","responses",",","and","also","affects","result","scoring",",","with","results","matching","the","user","\u2019","s","query","in","the","requested","language","being","preferred","over","results","that","match","in","another","language",".","You","can","pass","two","letters","country","codes","(","ISO","639-1",")",".","..","versionadded",":",":","2.3",":","param","bbox",":","The","bounding","box","of","the","viewport","within","which","to","bias","geocode","results","more","prominently",".","Example",":","``","[","Point","(","22",",","180",")",",","Point","(","-22",",","-180",")","]","``",".",":","type","bbox",":","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,
      proximity=None,
      country=None,
      language=None,
      bbox=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 proximity: A coordinate to bias local results based on a provided
          location.
      :type proximity: :class:`geopy.point.Point`, list or tuple of ``(latitude,
          longitude)``, or string as ``"%(latitude)s, %(longitude)s"``.
  
      :param country: Country to filter result in form of
          ISO 3166-1 alpha-2 country code (e.g. ``FR``).
          Might be a Python list of strings.
  
      :type country: str or list
  
      :param str language: This parameter controls the language of the text supplied in
          responses, and also affects result scoring, with results matching the user’s
          query in the requested language being preferred over results that match in
          another language. You can pass two letters country codes (ISO 639-1).
  
          .. versionadded:: 2.3
  
      :param bbox: The bounding box of the viewport within which
          to bias geocode results more prominently.
          Example: ``[Point(22, 180), Point(-22, -180)]``.
      :type bbox: 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["access_token"] = self.api_key
      if bbox:
          params["bbox"] = self._format_bounding_box(
              bbox, "%(lon1)s,%(lat1)s,%(lon2)s,%(lat2)s"
          )
  
      if not country:
          country = []
      if isinstance(country, str):
          country = [country]
      if country:
          params["country"] = ",".join(country)
  
      if proximity:
          p = Point(proximity)
          params["proximity"] = "%s,%s" % (p.longitude, p.latitude)
  
      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/mapbox.py
imports: from functools import partial
  from urllib.parse import quote, urlencode
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.point import Point
  from geopy.util import logger
label_desc: Use image node_id 3 for calling the MapBox obj's underlying member method code with example usage: obj.geocode(query) and returns: self