code: def pwned_password(password):
      
      if not isinstance(password, text_type):
          raise TypeError('Password values to check must be Unicode strings.')
      password_hash = hashlib.sha1(password.encode('utf-8')).hexdigest().upper()
      prefix, suffix = password_hash[:5], password_hash[5:]
      results = _get_pwned(prefix)
      if results is None:
          # Gracefully handle timeouts and HTTP error response codes.
          return None
      return results.get(suffix, 0)
docs: Checks a password against the Pwned Passwords database.