class_docstr: Geocoder using the Baidu Maps v2 API.
  
  Documentation at:
      http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-geocoding
  
  .. attention::
      Newly registered API keys will not work with v2 API,
      use :class:`.BaiduV3` instead.
class_docstr_tok: ["Geocoder","using","the","Baidu","Maps","v2","API",".","Documentation","at",":","http",":","\/\/lbsyun.baidu.com\/index.php","?","title=webapi\/guide\/webservice-geocoding","..","attention",":",":","Newly","registered","API","keys","will","not","work","with","v2","API",",","use",":","class",":","`",".BaiduV3","`","instead","."]
docstr: :param str api_key: The API key (AK) required by Baidu Map to perform
      geocoding requests. API keys are managed through the Baidu APIs
      console (http://lbsyun.baidu.com/apiconsole/key).
  
  :param str scheme:
      See :attr:`geopy.geocoders.options.default_scheme`.
  
  :param int timeout:
      See :attr:`geopy.geocoders.options.default_timeout`.
  
  :param dict proxies:
      See :attr:`geopy.geocoders.options.default_proxies`.
  
  :param str user_agent:
      See :attr:`geopy.geocoders.options.default_user_agent`.
  
  :type ssl_context: :class:`ssl.SSLContext`
  :param ssl_context:
      See :attr:`geopy.geocoders.options.default_ssl_context`.
  
  :param callable adapter_factory:
      See :attr:`geopy.geocoders.options.default_adapter_factory`.
  
      .. versionadded:: 2.0
  
  :param str security_key: The security key (SK) to calculate
      the SN parameter in request if authentication setting requires
      (http://lbsyun.baidu.com/index.php?title=lbscloud/api/appendix).
docstr_tok: [":","param","str","api_key",":","The","API","key","(","AK",")","required","by","Baidu","Map","to","perform","geocoding","requests",".","API","keys","are","managed","through","the","Baidu","APIs","console","(","http",":","\/\/lbsyun.baidu.com\/apiconsole\/key",")",".",":","param","str","scheme",":","See",":","attr",":","`","geopy.geocoders.options.default_scheme","`",".",":","param","int","timeout",":","See",":","attr",":","`","geopy.geocoders.options.default_timeout","`",".",":","param","dict","proxies",":","See",":","attr",":","`","geopy.geocoders.options.default_proxies","`",".",":","param","str","user_agent",":","See",":","attr",":","`","geopy.geocoders.options.default_user_agent","`",".",":","type","ssl_context",":",":","class",":","`","ssl.SSLContext","`",":","param","ssl_context",":","See",":","attr",":","`","geopy.geocoders.options.default_ssl_context","`",".",":","param","callable","adapter_factory",":","See",":","attr",":","`","geopy.geocoders.options.default_adapter_factory","`",".","..","versionadded",":",":","2.0",":","param","str","security_key",":","The","security","key","(","SK",")","to","calculate","the","SN","parameter","in","request","if","authentication","setting","requires","(","http",":","\/\/lbsyun.baidu.com\/index.php","?","title=lbscloud\/api\/appendix",")","."]
code: def __init__(
      self,
      api_key,
      *,
      scheme=None,
      timeout=DEFAULT_SENTINEL,
      proxies=DEFAULT_SENTINEL,
      user_agent=None,
      ssl_context=DEFAULT_SENTINEL,
      adapter_factory=None,
      security_key=None,
  ):
      """
  
      :param str api_key: The API key (AK) required by Baidu Map to perform
          geocoding requests. API keys are managed through the Baidu APIs
          console (http://lbsyun.baidu.com/apiconsole/key).
  
      :param str scheme:
          See :attr:`geopy.geocoders.options.default_scheme`.
  
      :param int timeout:
          See :attr:`geopy.geocoders.options.default_timeout`.
  
      :param dict proxies:
          See :attr:`geopy.geocoders.options.default_proxies`.
  
      :param str user_agent:
          See :attr:`geopy.geocoders.options.default_user_agent`.
  
      :type ssl_context: :class:`ssl.SSLContext`
      :param ssl_context:
          See :attr:`geopy.geocoders.options.default_ssl_context`.
  
      :param callable adapter_factory:
          See :attr:`geopy.geocoders.options.default_adapter_factory`.
  
          .. versionadded:: 2.0
  
      :param str security_key: The security key (SK) to calculate
          the SN parameter in request if authentication setting requires
          (http://lbsyun.baidu.com/index.php?title=lbscloud/api/appendix).
      """
      super().__init__(
          scheme=scheme,
          timeout=timeout,
          proxies=proxies,
          user_agent=user_agent,
          ssl_context=ssl_context,
          adapter_factory=adapter_factory,
      )
      self.api_key = api_key
      self.api = "%s://api.map.baidu.com%s" % (
          self.scheme,
          self.api_path,
      )
      self.reverse_api = "%s://api.map.baidu.com%s" % (
          self.scheme,
          self.reverse_path,
      )
      self.security_key = security_key
  
file_path: geopy/geopy/geocoders/baidu.py
imports: import hashlib
  from functools import partial
  from urllib.parse import quote_plus, urlencode
  from geopy.exc import GeocoderAuthenticationFailure, GeocoderQueryError, GeocoderQuotaExceeded, GeocoderServiceError
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.util import logger
label_desc: Use image node_id 1 to create a new Baidu object from inherited base classes: Geocoder with example: obj = Baidu(api_key)