def login(self, password):
if self.logged_in:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>params = {"<STR_LIT:name>": self.nick, "<STR_LIT:password>": password}<EOL>resp = self.conn.make_api_call("<STR_LIT>", params)<EOL>if "<STR_LIT:error>" in resp:<EOL><INDENT>raise RuntimeError(<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT>self.session = resp["<STR_LIT>"]<EOL>self.conn.make_call("<STR_LIT>", self.session)<EOL>self.conn.cookies.update({"<STR_LIT>": self.session})<EOL>self.logged_in = True<EOL>return True<EOL>
Attempts to log in as the current user with given password