def login(self):
_LOGGER.debug("<STR_LIT>")<EOL>login_post = {'<STR_LIT>': '<STR_LIT>', '<STR_LIT:action>': '<STR_LIT>'}<EOL>if self._username:<EOL><INDENT>login_post['<STR_LIT:username>'] = self._username<EOL><DEDENT>if self._password:<EOL><INDENT>login_post['<STR_LIT:password>'] = self._password<EOL><DEDENT>req = requests.post(urljoin(self._server_url, '<STR_LIT>'),<EOL>data=login_post, verify=self._verify_ssl)<EOL>self._cookies = req.cookies<EOL>req = requests.get(<EOL>urljoin(self._server_url, '<STR_LIT>'),<EOL>cookies=self._cookies,<EOL>timeout=ZoneMinder.DEFAULT_TIMEOUT,<EOL>verify=self._verify_ssl)<EOL>if not req.ok:<EOL><INDENT>_LOGGER.error("<STR_LIT>")<EOL>return False<EOL><DEDENT>return True<EOL>
Login to the ZoneMinder API.