code: def _safe_readline(fd) -> str:
      pos = fd.tell()
      while True:
          try:
              return fd.readline()
          except UnicodeDecodeError:
              pos -= 1
              fd.seek(pos)
  
file_path: fairseq/fairseq/file_chunker_utils.py
imports: import os
  import typing
label_desc: Use image node_id 1 for calling a global function with example usage: _safe_readline(fd) and returns: fd