def set_token(self, token):
if token:<EOL><INDENT>auth = HTTPBasicAuth(token, '<STR_LIT>')<EOL>self._token = token<EOL>self.authenticated = True  <EOL>self.session.auth = auth<EOL>logger.debug("<STR_LIT>", token)<EOL><DEDENT>else:<EOL><INDENT>self._token = None<EOL>self.authenticated = False<EOL>self.session.auth = None<EOL>logger.debug("<STR_LIT>")<EOL><DEDENT>
Set token in authentification for next requests
:param token: str. token to set in auth. If None, reinit auth