class_docstr: Used to zip multiple files in zip chunks of a particular size, all in parallel
class_docstr_tok: ["Used","to","zip","multiple","files","in","zip","chunks","of","a","particular","size",",","all","in","parallel"]
docstr: Initialize the ParallelZipper. Each zip created by this object will have the following naming
  format: [zip_prefix]<random_string>[zip_suffix]
  
  :param chunk_size: Chunk size, in MB. The ParallelZipper will try its best not to exceed this size,
      but that is not guaranteed
  :param max_workers: The maximum number of workers spawned when zipping the files
  :param allow_zip_64: if True, ZipFile will create files with ZIP64 extensions when
      needed, otherwise it will raise an exception when this would be necessary
  :param compression: ZipFile.ZIP_STORED (no compression), ZipFile.ZIP_DEFLATED (requires zlib),
      ZipFile.ZIP_BZIP2 (requires bz2) or ZipFile.ZIP_LZMA (requires lzma).
  :param zip_prefix: Zip file names will be prefixed by this
  :param zip_suffix: Zip file names will pe suffixed by this
  :param verbose: If True, print data relevant to the file compression
  :param task: ClearML Task, used for logging
  :param pool: Use this ThreadPoolExecutor instead of creating one. Note that this pool will not be
      closed after zipping is finished.
  
  :return: ParallelZipper instance
docstr_tok: ["Initialize","the","ParallelZipper",".","Each","zip","created","by","this","object","will","have","the","following","naming","format",":","[","zip_prefix","]","<","random_string",">","[","zip_suffix","]",":","param","chunk_size",":","Chunk","size",",","in","MB",".","The","ParallelZipper","will","try","its","best","not","to","exceed","this","size",",","but","that","is","not","guaranteed",":","param","max_workers",":","The","maximum","number","of","workers","spawned","when","zipping","the","files",":","param","allow_zip_64",":","if","True",",","ZipFile","will","create","files","with","ZIP64","extensions","when","needed",",","otherwise","it","will","raise","an","exception","when","this","would","be","necessary",":","param","compression",":","ZipFile.ZIP_STORED","(","no","compression",")",",","ZipFile.ZIP_DEFLATED","(","requires","zlib",")",",","ZipFile.ZIP_BZIP2","(","requires","bz2",")","or","ZipFile.ZIP_LZMA","(","requires","lzma",")",".",":","param","zip_prefix",":","Zip","file","names","will","be","prefixed","by","this",":","param","zip_suffix",":","Zip","file","names","will","pe","suffixed","by","this",":","param","verbose",":","If","True",",","print","data","relevant","to","the","file","compression",":","param","task",":","ClearML","Task",",","used","for","logging",":","param","pool",":","Use","this","ThreadPoolExecutor","instead","of","creating","one",".","Note","that","this","pool","will","not","be","closed","after","zipping","is","finished",".",":","return",":","ParallelZipper","instance"]
code: def __init__(
      self,
      chunk_size,  # type: int
      max_workers,  # type: int
      allow_zip_64=True,  # type: Optional[bool]
      compression=ZIP_DEFLATED,  # type: Optional[Any]
      zip_prefix="",  # type: Optional[str]
      zip_suffix="",  # type: Optional[str]
      verbose=False,  # type: Optional[bool]
      task=None,  # type: Optional[Any]
      pool=None,  # type: Optional[ThreadPoolExecutor]
  ):
      # type: (...) -> ParallelZipper
      """
      Initialize the ParallelZipper. Each zip created by this object will have the following naming
      format: [zip_prefix]<random_string>[zip_suffix]
  
      :param chunk_size: Chunk size, in MB. The ParallelZipper will try its best not to exceed this size,
          but that is not guaranteed
      :param max_workers: The maximum number of workers spawned when zipping the files
      :param allow_zip_64: if True, ZipFile will create files with ZIP64 extensions when
          needed, otherwise it will raise an exception when this would be necessary
      :param compression: ZipFile.ZIP_STORED (no compression), ZipFile.ZIP_DEFLATED (requires zlib),
          ZipFile.ZIP_BZIP2 (requires bz2) or ZipFile.ZIP_LZMA (requires lzma).
      :param zip_prefix: Zip file names will be prefixed by this
      :param zip_suffix: Zip file names will pe suffixed by this
      :param verbose: If True, print data relevant to the file compression
      :param task: ClearML Task, used for logging
      :param pool: Use this ThreadPoolExecutor instead of creating one. Note that this pool will not be
          closed after zipping is finished.
  
      :return: ParallelZipper instance
      """
      self._chunk_size = chunk_size * (1024**2)
      self._max_workers = max_workers
      self._allow_zip_64 = allow_zip_64
      self._compression = compression
      self._zip_prefix = zip_prefix
      self._zip_suffix = zip_suffix
      self._verbose = verbose
      self._task = task
      self._pool = pool
      self._zipper_queue = PriorityQueue()
      self._zipper_results = Queue()
  
imports: import os
  from copy import deepcopy
  from time import sleep
  from concurrent.futures import ThreadPoolExecutor
  from typing import Any, Callable, Optional, Union, Generator, List, Type
  from zipfile import ZipFile, ZIP_DEFLATED
  from six.moves.queue import PriorityQueue, Queue, Empty
  from pathlib2 import Path
  from tempfile import mkstemp
  from collections import deque
  from threading import Thread
  from ..debugging.log import LoggerRoot
  from ..storage.util import format_size
label_desc: Use image node_id 1 to create a new ParallelZipper object from inherited base classes: object with example: obj = ParallelZipper(chunk_size, max_workers, allow_zip_64, compression, zip_prefix, zip_suffix, verbose, task, pool)