class_docstr: Geocoder using the Bing Maps Locations API.
  
  Documentation at:
      https://msdn.microsoft.com/en-us/library/ff701715.aspx
class_docstr_tok: ["Geocoder","using","the","Bing","Maps","Locations","API",".","Documentation","at",":","https",":","\/\/msdn.microsoft.com\/en-us\/library\/ff701715.aspx"]
docstr: Return a location point by address.
  
  :param query: The address or query you wish to geocode.
  
      For a structured query, provide a dictionary whose keys
      are one of: `addressLine`, `locality` (city),
      `adminDistrict` (state), `countryRegion`, or `postalCode`.
  :type query: str or dict
  
  :param bool exactly_one: Return one result or a list of results, if
      available.
  
  :param user_location: Prioritize results closer to
      this location.
  :type user_location: :class:`geopy.point.Point`
  
  :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 str culture: Affects the language of the response,
      must be a two-letter country code.
  
  :param bool include_neighborhood: Sets whether to include the
      neighborhood field in the response.
  
  :param bool include_country_code: Sets whether to include the
      two-letter ISO code of the country in the response (field name
      'countryRegionIso2').
  
  :rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
      ``exactly_one=False``.
docstr_tok: ["Return","a","location","point","by","address",".",":","param","query",":","The","address","or","query","you","wish","to","geocode",".","For","a","structured","query",",","provide","a","dictionary","whose","keys","are","one","of",":","`","addressLine","`",",","`","locality","`","(","city",")",",","`","adminDistrict","`","(","state",")",",","`","countryRegion","`",",","or","`","postalCode","`",".",":","type","query",":","str","or","dict",":","param","bool","exactly_one",":","Return","one","result","or","a","list","of","results",",","if","available",".",":","param","user_location",":","Prioritize","results","closer","to","this","location",".",":","type","user_location",":",":","class",":","`","geopy.point.Point","`",":","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","str","culture",":","Affects","the","language","of","the","response",",","must","be","a","two-letter","country","code",".",":","param","bool","include_neighborhood",":","Sets","whether","to","include","the","neighborhood","field","in","the","response",".",":","param","bool","include_country_code",":","Sets","whether","to","include","the","two-letter","ISO","code","of","the","country","in","the","response","(","field","name","'countryRegionIso2","'",")",".",":","rtype",":","``","None","``",",",":","class",":","`","geopy.location.Location","`","or","a","list","of","them",",","if","``","exactly_one=False","``","."]
code: def geocode(
      self,
      query,
      *,
      exactly_one=True,
      user_location=None,
      timeout=DEFAULT_SENTINEL,
      culture=None,
      include_neighborhood=None,
      include_country_code=False,
  ):
      """
      Return a location point by address.
  
      :param query: The address or query you wish to geocode.
  
          For a structured query, provide a dictionary whose keys
          are one of: `addressLine`, `locality` (city),
          `adminDistrict` (state), `countryRegion`, or `postalCode`.
      :type query: str or dict
  
      :param bool exactly_one: Return one result or a list of results, if
          available.
  
      :param user_location: Prioritize results closer to
          this location.
      :type user_location: :class:`geopy.point.Point`
  
      :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 str culture: Affects the language of the response,
          must be a two-letter country code.
  
      :param bool include_neighborhood: Sets whether to include the
          neighborhood field in the response.
  
      :param bool include_country_code: Sets whether to include the
          two-letter ISO code of the country in the response (field name
          'countryRegionIso2').
  
      :rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
          ``exactly_one=False``.
      """
      if isinstance(query, collections.abc.Mapping):
          params = {
              key: val
              for key, val in query.items()
              if key in self.structured_query_params
          }
          params["key"] = self.api_key
      else:
          params = {"query": query, "key": self.api_key}
      if user_location:
          params["userLocation"] = self._coerce_point_to_string(
              user_location
          )
      if exactly_one:
          params["maxResults"] = 1
      if culture:
          params["culture"] = culture
      if include_neighborhood is not None:
          params["includeNeighborhood"] = include_neighborhood
      if include_country_code:
          params["include"] = "ciso2"  # the only acceptable value
  
      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/bing.py
imports: import collections.abc
  from functools import partial
  from urllib.parse import quote, urlencode
  from geopy.exc import GeocoderAuthenticationFailure, GeocoderInsufficientPrivileges, GeocoderRateLimited, GeocoderServiceError, GeocoderUnavailable
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.util import join_filter, logger
label_desc: Use image node_id 2 for calling the Bing obj's underlying member method code with example usage: obj.geocode(query) and returns: self