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: Validates error statuses.
docstr_tok: ["Validates","error","statuses","."]
code: def _check_status(self, status):
      """
      Validates error statuses.
      """
      if status == 0:
          # When there are no results, just return.
          return
      if status == 1:
          raise GeocoderServiceError("Internal server error.")
      elif status == 2:
          raise GeocoderQueryError("Invalid request.")
      elif status == 3:
          raise GeocoderAuthenticationFailure("Authentication failure.")
      elif status == 4:
          raise GeocoderQuotaExceeded("Quota validate failure.")
      elif status == 5:
          raise GeocoderQueryError("AK Illegal or Not Exist.")
      elif status == 101:
          raise GeocoderAuthenticationFailure("No AK")
      elif status == 102:
          raise GeocoderAuthenticationFailure("MCODE Error")
      elif status == 200:
          raise GeocoderAuthenticationFailure("Invalid AK")
      elif status == 211:
          raise GeocoderAuthenticationFailure("Invalid SN")
      elif 200 <= status < 300:
          raise GeocoderAuthenticationFailure("Authentication Failure")
      elif 300 <= status < 500:
          raise GeocoderQuotaExceeded("Quota Error.")
      else:
          raise GeocoderQueryError("Unknown error. Status: %r" % status)
  
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 7 for calling the Baidu obj's underlying member method code with example usage: obj._check_status(status) without return types