code: def format(collection, **params):
      
      binary = io.BytesIO()
      with zipfile.ZipFile(binary, 'w') as zip_:
          now = datetime.datetime.utcnow().timetuple()
          for filename, content in collection:
              content_type, encoding = mimetypes.guess_type(filename)
              content = content_types.get(content_type).parse(content, **params)
              content = content_encodings.get(encoding).decode(content)
              zip_info = zipfile.ZipInfo(filename, now)
              zip_info.file_size = len(content)
              zip_.writestr(zip_info, content)
      binary.seek(0)
      return binary.read()
docs: Truns a python object into a ZIP file.