  from django.core.exceptions import ImproperlyConfigured
  from rest_framework import exceptions, HTTP_HEADER_ENCODING
  from rest_framework.compat import CsrfViewMiddleware
  from rest_framework.authtoken.models import Token
  import base64
  
  
  class BaseAuthentication(object):
      """
 
</s> remove from django.core.exceptions import ImproperlyConfigured
try:
    import oauth2
except ImportError:
    oauth2 = None

try:
    import oauth_provider
    from oauth_provider.store import store
except ImportError:
    oauth_provider = None

 </s> add  </s> remove         :returns: two-tuple of (user, auth) if authentication succeeds, or None otherwise.
 </s> add         Returns two-tuple of (user, auth token) if authentication succeeds, or None otherwise. </s> remove     django-oath-plus"""
 </s> add     django-oath-plus and oauth2""" </s> remove         return store.check_nonce(request, oauth_request, oauth_request['oauth_nonce'])
 </s> add         return oauth_provider.store.store.check_nonce(request, oauth_request, oauth_request['oauth_nonce'])
from rest_framework.compat import oauth
from rest_framework.compat import oauth_provider
  from django.core.exceptions import ImproperlyConfigured
  from rest_framework import exceptions, HTTP_HEADER_ENCODING
  from rest_framework.compat import CsrfViewMiddleware
from rest_framework.compat import oauth
from rest_framework.compat import oauth_provider
  from rest_framework.authtoken.models import Token
  import base64
  
  
  class BaseAuthentication(object):
      """
keep keep add keep keep keep keep keep keep
 Move oauth2 and django-oauth-plus imports to compat and fix some minor issues

- alias oauth2 as oauth
- remove rouge print
- remove docstring markups
- OAuthAuthentication.authenticate() now returns (user, token) two-tuple on success
- don't set request.user because it's already set 
rest_framework/authentication.py