nlp.util.generate_batches robust to csv.reader iterators that fail on windows newlines