def repl(self, clean_code, lastonly):
    ' REPL\n\n        If `self.debug==True` then result is the raw list of lines of bytes,\n        otherwise, it is a list of (lineNumber, stdoutLines, valueLines, typeLines),\n        where again the last 3 entries are lists of lines of bytes. \n        '
    self.proc.sendline(clean_code)
    EOT = False
    debug_lines = []
    nodes = []
    node = ()
    linenumber = None
    state = None
    for echoline in self.proc:
        if ((echoline[:1] == b'i') and echoline.endswith(b'noop(begin)--CMD\r\n')):
            break
    while (not EOT):
        try:
            for testline in self.proc:
                line = testline[:(- 2)]
                if self.debug:
                    print(line)
                break
        except pexpect.TIMEOUT:
            self.proc.sendcontrol('c')
            self.proc.read(1)
            if node:
                node[1].append('\r\no{} = [KERNEL ENFORCED TIMEOUT]'.format(linenumber).encode())
                nodes.append(node)
            return (debug_lines if self.debug else nodes)
        if line.endswith(b'--EOB'):
            EOT = True
        if self.debug:
            debug_lines.append(line)
            continue
        if line.endswith(b'--CMD'):
            newinput = self.patt_input.match(line)
            if newinput:
                if node:
                    if lastonly:
                        nodes.append((node[0], node[1], [], []))
                    else:
                        nodes.append(node)
                linenumber = int(newinput.groups()[0])
                node = (linenumber, [], [], [])
                state = 'CMD'
        elif line.endswith(b'--VAL'):
            state = 'VAL'
        elif line.endswith(b'--CLS'):
            state = 'CLS'
        elif (state == 'CMD'):
            node[1].append(line)
        elif (state == 'VAL'):
            node[2].append(line)
        elif (state == 'CLS'):
            node[3].append(line)
    if (not node):
        pass
    elif node[2]:
        nodes.append((node[0], node[1], node[2], node[3][:(- 1)]))
    else:
        nodes.append((node[0], node[1][:(- 1)], [], []))
    return (debug_lines if self.debug else nodes)
REPL

If `self.debug==True` then result is the raw list of lines of bytes,
otherwise, it is a list of (lineNumber, stdoutLines, valueLines, typeLines),
where again the last 3 entries are lists of lines of bytes.
def repl(self, clean_code, lastonly):
    ' REPL\n\n        If `self.debug==True` then result is the raw list of lines of bytes,\n        otherwise, it is a list of (lineNumber, stdoutLines, valueLines, typeLines),\n        where again the last 3 entries are lists of lines of bytes. \n        '
    self.proc.sendline(clean_code)
    EOT = False
    debug_lines = []
    nodes = []
    node = ()
    linenumber = None
    state = None
    for echoline in self.proc:
        if ((echoline[:1] == b'i') and echoline.endswith(b'noop(begin)--CMD\r\n')):
            break
    while (not EOT):
        try:
            for testline in self.proc:
                line = testline[:(- 2)]
                if self.debug:
                    print(line)
                break
        except pexpect.TIMEOUT:
            self.proc.sendcontrol('c')
            self.proc.read(1)
            if node:
                node[1].append('\r\no{} = [KERNEL ENFORCED TIMEOUT]'.format(linenumber).encode())
                nodes.append(node)
            return (debug_lines if self.debug else nodes)
        if line.endswith(b'--EOB'):
            EOT = True
        if self.debug:
            debug_lines.append(line)
            continue
        if line.endswith(b'--CMD'):
            newinput = self.patt_input.match(line)
            if newinput:
                if node:
                    if lastonly:
                        nodes.append((node[0], node[1], [], []))
                    else:
                        nodes.append(node)
                linenumber = int(newinput.groups()[0])
                node = (linenumber, [], [], [])
                state = 'CMD'
        elif line.endswith(b'--VAL'):
            state = 'VAL'
        elif line.endswith(b'--CLS'):
            state = 'CLS'
        elif (state == 'CMD'):
            node[1].append(line)
        elif (state == 'VAL'):
            node[2].append(line)
        elif (state == 'CLS'):
            node[3].append(line)
    if (not node):
        pass
    elif node[2]:
        nodes.append((node[0], node[1], node[2], node[3][:(- 1)]))
    else:
        nodes.append((node[0], node[1][:(- 1)], [], []))
    return (debug_lines if self.debug else nodes)