def setauth(self, user_or_apikey=None, user_password=None):
auth = None<EOL>if user_or_apikey is not None:<EOL><INDENT>if user_password is None:<EOL><INDENT>user_password = user_or_apikey<EOL>user_or_apikey = "<STR_LIT>"<EOL><DEDENT>auth = HTTPBasicAuth(user_or_apikey, user_password)<EOL>self.r.auth = auth<EOL><DEDENT>self.ws.setauth(auth)<EOL>
setauth sets the authentication header for use in the session.
        It is for use when apikey is updated or something of the sort, such that
        there is a seamless experience.