def DeleteDomainUser(self, user_mail, verify=False):
    """Deletes user from the domain.

    Checks if the user already exists before attempting delete.

    Args:
      user_mail: user_mail to add.
      verify: If True, verify user was deleted.

    Raises:
      AdminAPIToolUserError: Unable to delete user.
    """
    log_utils.LogDebug('DeleteDomainUser (%s).' % user_mail)
    if not self.IsDomainUser(user_mail):
      raise admin_api_tool_errors.AdminAPIToolUserError(
          'ERROR: user (%s) not a domain member. You may need to check "Enable '
          'provisioning API" in your Domain Settings->User Settings.' % (
              user_mail))
    backoff = http_utils.Backoff()
    while backoff.Loop():
      try:
        self._users.delete(userKey=user_mail).execute()
        if verify:
          time.sleep(2)  # Seems to be needed for Verify to work consistently.
          if self.IsDomainUser(user_mail):
            raise admin_api_tool_errors.AdminAPIToolUserError(
                'Problem deleting user %s.' % user_mail)
        return
      except apiclient_errors.HttpError as e:
        if e.resp.status not in http_utils.RETRY_RESPONSE_CODES:
          raise admin_api_tool_errors.AdminAPIToolUserError(
              http_utils.ParseHttpResult(e.uri, e.resp, e.content))
        log_utils.LogInfo(
            'Possible quota problem deleting user %s (%d). Retrying after '
            'a short wait.' % (user_mail, e.resp.status))
        backoff.Fail()
dataset/ETHPy150Open google/gfw-toolkit/toolkit/admin_sdk_directory_api/users_api.py/UsersApiWrapper.DeleteDomainUser/original