def setauth(self,basic_auth):
self.headers = []<EOL>if basic_auth is not None:<EOL><INDENT>class auth_extractor():<EOL><INDENT>def __init__(self):<EOL><INDENT>self.headers = {}<EOL><DEDENT><DEDENT>extractor = auth_extractor()<EOL>basic_auth(extractor)<EOL>for header in extractor.headers:<EOL><INDENT>self.headers.append("<STR_LIT>" % (header, extractor.headers[header]))<EOL><DEDENT><DEDENT>
setauth can be used during runtime to make sure that authentication is reset.
        it can be used when changing passwords/apikeys to make sure reconnects succeed