<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format(collection, **params):
 """Truns a python object into a ZIP file."""

    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()