def __init__(self, ds, num_proc, map_func, batch_size, buffer_size=None):
        """
        Args:
            ds (DataFlow): the dataflow to map
            num_proc(int): number of threads to use
            map_func (callable): datapoint -> datapoint | None. Return None to
                discard/skip the datapoint.
            batch_size (int): batch size
            buffer_size (int): number of datapoints (not batched) in the buffer.
                Defaults to batch_size * 10
        """
        super(MultiProcessMapAndBatchDataZMQ, self).__init__()
        assert batch_size < buffer_size
        self.ds = ds
        self.num_proc = num_proc
        self.map_func = map_func
        self.batch_size = batch_size
        if buffer_size is None:
            buffer_size = batch_size * 10
        self.buffer_size = buffer_size

        Args:
            ds (DataFlow): the dataflow to map
            num_proc(int): number of threads to use
            map_func (callable): datapoint -> datapoint | None. Return None to
                discard/skip the datapoint.
            batch_size (int): batch size
            buffer_size (int): number of datapoints (not batched) in the buffer.
                Defaults to batch_size * 10
        
tensorpack/dataflow/parallel_map.py