  
      def authenticate_header(self, request):
          """
          If permission is denied, return a '401 Unauthorized' response,
          with an appropraite 'WWW-Authenticate' header.
          """
          return 'OAuth realm="%s"' % self.www_authenticate_realm
  
      def validate_token(self, request, consumer, token):
          """
 
</s> remove         return Response(status=status.INTERNAL_SERVER_ERROR)
 </s> add         return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR) </s> remove     def initialize_request(self, request, *args, **kargs):
 </s> add     def initialize_request(self, request, *args, **kwargs): </s> remove         raise ImproperlyConfigured('Returned a template response with no `template_name` attribute set on either the view or response')
 </s> add         raise ImproperlyConfigured(
            'Returned a template response with no `template_name` attribute set on either the view or response'
        ) </s> remove         # types might return a non-primative value for the pk otherwise.
 </s> add         # types might return a non-primitive value for the pk otherwise. </s> remove     don't need to dig into the implemention.
 </s> add     don't need to dig into the implementation.
        with an appropriate 'WWW-Authenticate' header.
  
      def authenticate_header(self, request):
          """
          If permission is denied, return a '401 Unauthorized' response,
        with an appropriate 'WWW-Authenticate' header.
          """
          return 'OAuth realm="%s"' % self.www_authenticate_realm
  
      def validate_token(self, request, consumer, token):
          """
keep keep keep keep replace keep keep keep keep keep
 Removed unused imports, pep8 fixes, typo fixes 
rest_framework/authentication.py