def GetDomainUser(self, user_mail):
    """Retrieve document for a user in an apps domain.

    A common reason to call this is to retrieve the user_id from an email name.

    Args:
      user_mail: username to check.

    Returns:
      The user document (available fields listed in _PrintOneUser()).
    """
    log_utils.LogDebug('GetDomainUser (%s).' % user_mail)
    request = self._users.get(userKey=user_mail)
    backoff = http_utils.Backoff()
    while backoff.Loop():
      try:
        return request.execute()
      except apiclient_errors.HttpError as e:  # Missing user raises HttpError.
        if e.resp.status not in http_utils.RETRY_RESPONSE_CODES:
          error_text = http_utils.ParseHttpResult(e.uri, e.resp, e.content)
          if error_text.startswith('ERROR: status=404'):
            # User not found is reflected by 404 - resource not found.
            return None
          raise admin_api_tool_errors.AdminAPIToolUserError(
              'User %s not found: %s' % (user_mail, error_text))
        log_utils.LogInfo(
            'Possible quota problem retrieving 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.GetDomainUser/original