mm.seek(lo)
while True:
    line = mm.readline()
if not line.startswith(ident):
    break
yield line.decode()
with open(filename) as f:
    r = csv.reader(islice(iter_symbol_lines(f, 'AMZN'), 10))
for line in r:
    pass
Fast extraction of chunks of lines from large CSV file