code: def read(filename, binary=True):
      
      with open(filename, 'rb' if binary else 'r') as f:
          return f.read()
docs: Open and read a file
  
      :param filename: filename to open and read
      :param binary: True if the file should be read as binary
      :return: bytes if binary is True, str otherwise