def _align_to_newline(self):
        fo, bsize = self._file_obj, self._blocksize
        cur, total_read = '', 0
        cur_pos = fo.tell()
        while '\n' not in cur:
            cur = fo.read(bsize)
            total_read += bsize
        try:
            newline_offset = cur.index('\n') + total_read - bsize
        except ValueError:
            raise  # TODO: seek to end?
        fo.seek(cur_pos + newline_offset)
Aligns the file object's position to the next newline.
dataset/ETHPy150Open mahmoud/boltons/boltons/jsonutils.py/JSONLIterator._align_to_newline