def kill(self, sig):

        '''This sends the given signal to the child application. In keeping
        with UNIX tradition it has a misleading name. It does not necessarily
        kill the child unless you send the right signal. '''
        if not pty:
            if [signal.SIGINT, signal.CTRL_C_EVENT] in sig:
                sig = signal.CTRL_C_EVENT
            elif sig in [signal.SIGBREAK, signal.CTRL_BREAK_EVENT]:
                sig = signal.CTRL_BREAK_EVENT
            else:
                sig = signal.SIGTERM

        # Same as os.kill, but the pid is given for you.
        if self.isalive():
            os.kill(self.pid, sig)
dataset/ETHPy150Open Calysto/metakernel/metakernel/pexpect.py/spawn.kill/swapped operands of `in`