human
Here's a good function header given the following:
I wrote the below code

    _scopes = (scopes or [])
    def decorator(view_func):
        @wraps(view_func)
        def _validate(request, *args, **kwargs):
            provided_scopes = get_scopes_backend().get_all_scopes()
            read_write_scopes = [oauth2_settings.READ_SCOPE, oauth2_settings.WRITE_SCOPE]
            if (not set(read_write_scopes).issubset(set(provided_scopes))):
                raise ImproperlyConfigured("rw_protected_resource    decorator    requires    following    scopes    {0}    to    be    in    OAUTH2_PROVIDER['SCOPES']    list    in    settings".format(read_write_scopes))
            if (request.method.upper() in ['GET', 'HEAD', 'OPTIONS']):
                _scopes.append(oauth2_settings.READ_SCOPE)
            else:
                _scopes.append(oauth2_settings.WRITE_SCOPE)
            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 rw_protected_resource(scopes=None, validator_cls=OAuth2Validator, server_cls=Server):