code: def is_user_attempt_whitelisted(request: AxesHttpRequest, credentials: dict = None) -> bool:
      
  
      username_field = getattr(get_user_model(), 'USERNAME_FIELD', 'username')
      username_value = get_client_username(request, credentials)
      kwargs = {
          username_field: username_value
      }
  
      user_model = get_user_model()
  
      try:
          user = user_model.objects.get(**kwargs)
          return user.nolockout
      except (user_model.DoesNotExist, AttributeError):
          pass
  
      return False
docs: Check if the given request or credentials refer to a whitelisted username.
  
      A whitelisted user has the magic ``nolockout`` property set.
  
      If the property is unknown or False or the user can not be found,
      this implementation fails gracefully and returns True.