def is_user_attempt_whitelisted(request: AxesHttpRequest, credentials: dict = None) -> bool:
username_field = getattr(get_user_model(), '<STR_LIT>', '<STR_LIT:username>')<EOL>username_value = get_client_username(request, credentials)<EOL>kwargs = {<EOL>username_field: username_value<EOL>}<EOL>user_model = get_user_model()<EOL>try:<EOL><INDENT>user = user_model.objects.get(**kwargs)<EOL>return user.nolockout<EOL><DEDENT>except (user_model.DoesNotExist, AttributeError):<EOL><INDENT>pass<EOL><DEDENT>return False<EOL>
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.