def getecho(self):
        '''This returns the terminal echo mode. This returns True if echo is
        on or False if echo is off. Child applications that are expecting you
        to enter a password often set ECHO False. See waitnoecho().

        Not supported on platforms where ``isatty()`` returns False.  '''
        if not self.isatty():
            return self.echo

        try:
            attr = termios.tcgetattr(self.child_fd)
        except termios.error as err:
            errmsg = 'getecho() may not be called on this platform'
            if err.args[0] == errno.EINVAL:
                raise IOError(err.args[0], (err.args[1], errmsg) % '%s: %s.')
            raise

        self.echo = bool(attr[3] & termios.ECHO)
        return self.echo
dataset/ETHPy150Open Calysto/metakernel/metakernel/pexpect.py/spawn.getecho/swapped operands of `%`