class_docstr: Iterator to properly iterate over lines of a file chunck.
class_docstr_tok: ["Iterator","to","properly","iterate","over","lines","of","a","file","chunck","."]
code: def __iter__(self) -> tp.Iterable[str]:
      self._fd.seek(self._start_offset)
      # next(f) breaks f.tell(), hence readline() must be used
      line = _safe_readline(self._fd)
      while line:
          pos = self._fd.tell()
          # f.tell() does not always give the byte position in the file
          # sometimes it skips to a very large number
          # it is unlikely that through a normal read we go from
          # end bytes to end + 2**32 bytes (4 GB) and this makes it unlikely
          # that the procedure breaks by the undeterministic behavior of
          # f.tell()
          if (
              self._end_offset > 0
              and pos > self._end_offset
              and pos < self._end_offset + 2**32
          ):
              break
          yield line
          line = self._fd.readline()
  
file_path: fairseq/fairseq/file_chunker_utils.py
imports: import os
  import typing
label_desc: Use image node_id 2 for calling the ChunkLineIterator obj's underlying member method code with example usage: obj.__iter__() without return types