code: def open_with_encoding(filename,
                         encoding=None, mode='r', limit_byte_check=-1):
      
      if not encoding:
          encoding = detect_encoding(filename, limit_byte_check=limit_byte_check)
  
      return io.open(filename, mode=mode, encoding=encoding,
                     newline='')
docs: Return opened file with a specific encoding.