human
I wrote the below code

    _scopes = (scopes or [])
    def decorator(view_func):
        @wraps(view_func)
        def _validate(request, *args, **kwargs):
            validator = validator_cls()
            core = OAuthLibCore(server_cls(validator))
            (valid, oauthlib_req) = core.verify_request(request, scopes=_scopes)
            if valid:
                request.resource_owner = oauthlib_req.user
                return view_func(request, *args, **kwargs)
            return HttpResponseForbidden()
        return _validate
    return decorator

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

def protected_resource(scopes=None, validator_cls=OAuth2Validator, server_cls=Server):