human
I wrote the below code

    def decorator(view_func):
        @wraps(view_func, assigned=available_attrs(view_func))
        def _wrapped_view(request, *args, **kwargs):
            if test_func(request):
                return view_func(request, *args, **kwargs)
            path = request.build_absolute_uri()
            resolved_login_url = resolve_url((login_url or settings.LOGIN_URL))
            (login_scheme, login_netloc) = urllib.parse.urlparse(resolved_login_url)[:2]
            (current_scheme, current_netloc) = urllib.parse.urlparse(path)[:2]
            if (((not login_scheme) or (login_scheme == current_scheme)) and ((not login_netloc) or (login_netloc == current_netloc))):
                path = request.get_full_path()
            return redirect_to_login(path, resolved_login_url, redirect_field_name)
        return _wrapped_view
    return decorator

What's a good function header?

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

def user_passes_test(test_func, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):