      def check_nonce(self, request, oauth_request):
          """
          Checks nonce of request, and return True if valid.
          """
          return oauth_provider_store.check_nonce(request, oauth_request,
              oauth_request['oauth_nonce'], oauth_request['oauth_timestamp'])
  
  
  class OAuth2Authentication(BaseAuthentication):
      """
      OAuth 2 authentication backend using `django-oauth2-provider`
 
</s> remove from rest_framework.compat import oauth2_provider, provider_now
 </s> add from rest_framework.compat import oauth2_provider, provider_now, check_nonce </s> remove         from oauth_provider.models import Consumer, Resource
 </s> add         from oauth_provider.models import Consumer, Scope </s> remove         read_only_access_token.resource.is_readonly = True
        read_only_access_token.resource.save()
 </s> add         read_only_access_token.scope.is_readonly = True
        read_only_access_token.scope.save()
        oauth_nonce = oauth_request['oauth_nonce']
        oauth_timestamp = oauth_request['oauth_timestamp']
        return check_nonce(request, oauth_request, oauth_nonce, oauth_timestamp)
      def check_nonce(self, request, oauth_request):
          """
          Checks nonce of request, and return True if valid.
          """
        oauth_nonce = oauth_request['oauth_nonce']
        oauth_timestamp = oauth_request['oauth_timestamp']
        return check_nonce(request, oauth_request, oauth_nonce, oauth_timestamp)
        oauth_nonce = oauth_request['oauth_nonce']
        oauth_timestamp = oauth_request['oauth_timestamp']
        return check_nonce(request, oauth_request, oauth_nonce, oauth_timestamp)
  
  
  class OAuth2Authentication(BaseAuthentication):
      """
      OAuth 2 authentication backend using `django-oauth2-provider`
keep keep keep keep replace replace keep keep keep keep keep
 Compat fixes for django-oauth-plus versions 2.0-2.2.1 
rest_framework/authentication.py