code: def bin_open(fname: str):
      
      if fname.endswith(".gz"):
          return gzip.open(fname, "rb")
      return open(fname, "rb")
docs: Returns a file descriptor for a plain text or gzipped file, binary read mode
      for subprocess interaction.
  
      :param fname: The filename to open.
      :return: File descriptor in binary read mode.