def login(self, username, password, **kwargs):
        self.logout()
        self._secure = kwargs.get("secure", self._secure)
        self._imap4 = (self._secure and IMAP4_SSL or IMAP4)(self._host, self._port)
        try:
            status, response = self._imap4.login(username, password)
        except:
            raise MailLoginError
        if status != "OK":
            raise MailLoginError(response)
Signs in to the mail account with the given username and password,
dataset/ETHPy150Open clips/pattern/pattern/web/imap/__init__.py/Mail.login