human
Give me a the Python code you requested given the following:
Complete the below
def has_perm_or_owns_or_403(perm, owner_attr, obj_lookup, perm_obj_lookup, **kwargs):

    ''''Act like permission_required_or_403 but also grant permission to owners.
    Arguments:
    perm: authority permission to check, e.g. \'forums_forum.edit_forum\'
    owner_attr: Attr of model object that references the owner
    obj_lookup: Triple that specifies a lookup to the object on which
    ownership should be compared. Items in the tuple are...
    (model class or import path thereof,
    kwarg name specifying field and comparator (e.g. \'id__exact\'),
    name of kwarg containing the value to which to compare)
    perm_obj_lookup: Triple that specifies a lookup to the object on which
    to check for permission. Elements of the tuple are as in
    obj_lookup.'
    '''
assistant
#Here is the Python code you requested.
    def decorator(view_func):
        def _wrapped_view(request, *args, **kwargs):
            user = request.user
            if user.is_authenticated():
                obj = _resolve_lookup(obj_lookup, kwargs)
                perm_obj = _resolve_lookup(perm_obj_lookup, kwargs)
                granted = access.has_perm_or_owns(user, perm, obj, perm_obj, owner_attr)
                if (granted or user.has_perm(perm)):
                    return view_func(request, *args, **kwargs)
            return HttpResponseForbidden()
        return wraps(view_func)(_wrapped_view)
    return decorator