human
I wrote the below code

    def _check_one_permission_list(perms):
        regular_permissions = [perm for perm in perms if ('.' in perm)]
        conditions = [perm for perm in perms if ('.' not in perm)]
        if (conditions and ('is_anonymous' not in conditions) and ('is_active' not in conditions)):
            conditions.append('is_active')
        attributes = [getattr(user, perm) for perm in conditions]
        passes_conditions = all([(attr() if callable(attr) else bool(attr)) for attr in attributes])
        return (passes_conditions and user.has_perms(regular_permissions))
    if (not permissions):
        return True
    elif isinstance(permissions, list):
        return _check_one_permission_list(permissions)
    else:
        return any((_check_one_permission_list(perm) for perm in permissions))

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

def check_permissions(user, permissions):