'Prepares the given HTTP auth data.'

def prepare_auth(self, auth):

    if auth:
        if (isinstance(auth, tuple) and (len(auth) == 2)):
            auth = HTTPBasicAuth(*auth)
        r = auth(self)
        self.__dict__.update(r.__dict__)
