def findlinestarts(code, dup_lines=False):
if PYTHON3:<EOL><INDENT>byte_increments = code.co_lnotab[<NUM_LIT:0>::<NUM_LIT:2>]<EOL>line_increments = code.co_lnotab[<NUM_LIT:1>::<NUM_LIT:2>]<EOL><DEDENT>else:<EOL><INDENT>byte_increments = [ord(c) for c in code.co_lnotab[<NUM_LIT:0>::<NUM_LIT:2>]]<EOL>line_increments = [ord(c) for c in code.co_lnotab[<NUM_LIT:1>::<NUM_LIT:2>]]<EOL><DEDENT>lastlineno = None<EOL>lineno = code.co_firstlineno<EOL>addr = <NUM_LIT:0><EOL>for byte_incr, line_incr in zip(byte_increments, line_increments):<EOL><INDENT>if byte_incr:<EOL><INDENT>if (lineno != lastlineno or<EOL>(not dup_lines and <NUM_LIT:0> < byte_incr < <NUM_LIT:255>)):<EOL><INDENT>yield (addr, lineno)<EOL>lastlineno = lineno<EOL><DEDENT>addr += byte_incr<EOL><DEDENT>if line_incr >= <NUM_LIT>:<EOL><INDENT>line_incr -= <NUM_LIT><EOL><DEDENT>lineno += line_incr<EOL><DEDENT>if (lineno != lastlineno or<EOL>(not dup_lines and <NUM_LIT:0> < byte_incr < <NUM_LIT:255>)):<EOL><INDENT>yield (addr, lineno)<EOL><DEDENT>
Find the offsets in a byte code which are start of lines in the source.

    Generate pairs (offset, lineno) as described in Python/compile.c.