<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def anonymous_required(view, redirect_to=None):
 """ Only allow if user is NOT authenticated. """

    if redirect_to is None:
        redirect_to = settings.LOGIN_REDIRECT_URL

    @wraps(view)
    def wrapper(request, *a, **k):
        if request.user and request.user.is_authenticated():
            return HttpResponseRedirect(redirect_to)
        return view(request, *a, **k)
    return wrapper