from django.utils.datastructures import SortedDict


class WWWAuthenticateError(Exception):
    pass


class BaseAuth(object):
    def __init__(self, username, password):
        self.username = username
        self.password = password

    def _authenticate_headers(self, response):
        return SortedDict([(value.split(' ', 1)[0], value)
                           for header, value in response.items()
                           if header == 'WWW-Authenticate'])

    def _update_headers(self, request, response):
        auth = self.authorization(request, response)
        return auth and {'HTTP_AUTHORIZATION': auth} or {}

    def __call__(self, request, response=None):
        return self._update_headers(request, response)

@@ -2,34 +2,18 @@
 rom 
-django.utils.datastructure
+collection
 s im
@@ -17,20 +17,21 @@
  import 
-Sort
+Order
 edDict%0A%0A
@@ -282,12 +282,13 @@
 urn 
-Sort
+Order
 edDi
@@ -350,16 +350,17 @@
         
+ 
 for head
@@ -389,16 +389,17 @@
 items()%0A
+ 
         

replace SortedDict with OrderedDict