'content is a list of strings. it is unedited directive conent
This runs it line by line in the InteractiveShell, prepends
prompts as needed capturing stderr and stdout, then returns
the content as a list as if it were ipython code'

def process_pure_python2(self, content):

    output = []
    savefig = False
    multiline = False
    multiline_start = None
    fmtin = self.promptin
    ct = 0
    content = [line for line in content if (len(line.strip()) > 0)]
    for (lineno, line) in enumerate(content):
        line_stripped = line.strip()
        if (not len(line)):
            output.append(line)
            continue
        if line_stripped.startswith('@'):
            output.extend([line])
            if ('savefig' in line):
                savefig = True
            continue
        if line_stripped.startswith('#'):
            output.extend([line])
            continue
        continuation = (u'            %s:' % ''.join((['.'] * (len(str(ct)) + 2))))
        if (not multiline):
            modified = (u'%s    %s' % ((fmtin % ct), line_stripped))
            output.append(modified)
            ct += 1
            try:
                ast.parse(line_stripped)
                output.append(u'')
            except Exception:
                multiline = True
                multiline_start = lineno
        else:
            modified = (u'%s    %s' % (continuation, line))
            output.append(modified)
            try:
                ast.parse('\n'.join(content[multiline_start:(lineno + 1)]))
                if ((lineno < (len(content) - 1)) and (_count_indent(content[multiline_start]) < _count_indent(content[(lineno + 1)]))):
                    continue
                output.extend([continuation, u''])
                multiline = False
            except Exception:
                pass
        continue
    return output
