human
I wrote the below code

    def _checklogin(request, *args, **kwargs):
        if (request.user.is_active and request.user.is_staff):
            return view_func(request, *args, **kwargs)
        assert hasattr(request, 'session'), "The    Django    admin    requires    session    middleware    to    be    installed.    Edit    your    MIDDLEWARE_CLASSES    setting    to    insert    'django.contrib.sessions.middleware.SessionMiddleware'."
        if (LOGIN_FORM_KEY not in request.POST):
            if request.POST:
                message = _('Please    log    in    again,    because    your    session    has    expired.')
            else:
                message = ''
            return _display_login_form(request, message)
        if (not request.session.test_cookie_worked()):
            message = _("Looks    like    your    browser    isn't    configured    to    accept    cookies.    Please    enable    cookies,    reload    this    page,    and    try    again.")
            return _display_login_form(request, message)
        else:
            request.session.delete_test_cookie()
        username = request.POST.get('username', None)
        password = request.POST.get('password', None)
        user = authenticate(username=username, password=password)
        if (user is None):
            message = ERROR_MESSAGE
            if ('@' in username):
                users = list(User.objects.filter(email=username))
                if ((len(users) == 1) and users[0].check_password(password)):
                    message = (_("Your    e-mail    address    is    not    your    username.    Try    '%s'    instead.") % users[0].username)
            return _display_login_form(request, message)
        elif (user.is_active and user.is_staff):
            login(request, user)
            return http.HttpResponseRedirect(request.get_full_path())
        else:
            return _display_login_form(request, ERROR_MESSAGE)
    return wraps(view_func)(_checklogin)

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def staff_member_required(view_func):