'Generates lines as expected by tokenize from a list of lines.
This strips the first len(indent + self.PS1) characters off each line.'

def gen_lines(self, block, indent):

    prefix1 = (indent + self.PS1)
    prefix2 = (indent + self.PS2)
    prefix = prefix1
    for line in block:
        if line.startswith(prefix):
            (yield line[len(prefix):])
        elif (line == (prefix.rstrip() + '\n')):
            (yield '\n')
        else:
            raise AssertionError(('line=%r,    prefix=%r' % (line, prefix)))
        prefix = prefix2
    while True:
        (yield '')
