def login(self, username, password, login_prompt='login: ',
              password_prompt='Password: '):
        """Logs in to the Telnet server with the given user information.

        The login keyword reads from the connection until login_prompt
        is encountered and then types the user name. Then it reads
        until password_prompt is encountered and types the
        password. The rest of the output (if any) is also read, and
        all the text that has been read is returned as a single
        string.

        If a prompt has been set to this connection, either with `Open
        Connection` or `Set Prompt`, this keyword reads the output
        until the prompt is found. Otherwise, the keyword sleeps for a
        second and reads everything that is available.
        """
        ret = self.read_until(login_prompt, 'TRACE').decode('ASCII', 'ignore')
        self.write_bare(username + self._newline)
        ret += username + '\n'
        ret += self.read_until(password_prompt, 'TRACE').decode('ASCII', 'ignore')
        self.write_bare(password + self._newline)
        ret += '*' * len(password) + '\n'
        if self._prompt_is_set():
            try:
                ret += self.read_until_prompt('TRACE')
            except __HOLE__:
                self._verify_login(ret)
                raise
        else:
            ret += self._verify_login(ret)
        self._log(ret)
        return ret
dataset/ETHPy150Open shellderp/sublime-robot-plugin/lib/robot/libraries/Telnet.py/TelnetConnection.login