human
I wrote the below code

    if only_active:
        def deny_func(user):
            return (not (user.is_active and user.has_perm(perm)))
    else:
        def deny_func(user):
            return (not user.has_perm(perm))
    return user_access_decorator((lambda u: (not u.is_authenticated())), redirect_field=redirect, redirect_url_func=(lambda : login_url), deny_func=deny_func)

What's a good function header?

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

def permission_required(perm, login_url=None, redirect=REDIRECT_FIELD_NAME, only_active=True):