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","."]
code: def _construct_url(self, url, path, params):
      query_string = urlencode(params)
      if self.security_key is None:
          return "%s?%s" % (url, query_string)
      else:
          # http://lbsyun.baidu.com/index.php?title=lbscloud/api/appendix
          raw = "%s?%s%s" % (path, query_string, self.security_key)
          sn = hashlib.md5(quote_plus(raw).encode("utf-8")).hexdigest()
          return "%s?%s&sn=%s" % (url, query_string, sn)
  
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 8 for calling the Baidu obj's underlying member method code with example usage: obj._construct_url(url, path, params) and returns: unknown, unknown