def save_token(self):
if self.token is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>if not self.token_path.parent.exists():<EOL><INDENT>self.token_path.parent.mkdir(parents=True)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>log.error('<STR_LIT>'.format(str(e)))<EOL>return False<EOL><DEDENT>with self.token_path.open('<STR_LIT:w>') as token_file:<EOL><INDENT>self.serializer.dump(self.token, token_file, indent=True)<EOL><DEDENT>return True<EOL>
Saves the token dict in the specified file
:return bool: Success / Failure