code: def login(self, account=None, app_account=None, flush=True):
          
          with self._get_account(account) as account:
              if app_account is None:
                  app_account = account
              self.authenticate(account, flush=False)
              if self.get_driver().supports_auto_authorize():
                  self.expect_prompt()
              self.auto_app_authorize(app_account, flush=flush)
docs: Log into the connected host using the best method available.
          If an account is not given, default to the account that was
          used during the last call to login(). If a previous call was not
          made, use the account that was passed to the constructor. If that
          also fails, raise a TypeError.
  
          The app_account is passed to :class:`app_authenticate()` and
          :class:`app_authorize()`.
          If app_account is not given, default to the value of the account
          argument.
  
          :type  account: Account
          :param account: The account for protocol level authentication.
          :type  app_account: Account
          :param app_account: The account for app level authentication.
          :type  flush: bool
          :param flush: Whether to flush the last prompt from the buffer.