def connect(self, username, password):
        # Try to use oauth2 first.  It's much safer
        try:
            self._connect_oauth(username)
        except (TypeError, __HOLE__) as e:
            logger.warning("Couldn't do oauth2 because %s" % e)
            self.server = self.transport(self.hostname, self.port)
            typ, msg = self.server.login(username, password)
            self.server.select()
dataset/ETHPy150Open coddingtonbear/django-mailbox/django_mailbox/transports/gmail.py/GmailImapTransport.connect