Group the resulted collection to multiple chunk

        :@param size: 0
        :@type size: integer

        :@return Chunked List
3202
def chunk(self, size=0):
        

        if size == 0:
            raise ValueError('Invalid chunk size')

        self.__prepare()
        _new_content = []

        while(len(self._json_data) > 0):
            _new_content.append(self._json_data[0:size])
            self._json_data = self._json_data[size:]

        self._json_data = _new_content

        return self._json_data
166307
def chunks(iterable, chunk):
    """"""
    for i in range(0, len(iterable), chunk):
        yield iterable[i:i + chunk]
1259847
def chunks(lst, size):
    """"""
    for i in xrange(0, len(lst), size):
        yield lst[i:i + size]
1107555
protected List<T> getBatchChunk(List<T> list, int batchSize, int chunkNumber) {
        if (list == null || list.isEmpty()) {
            return null;
        }

        final int start = chunkNumber * batchSize;
        final int end = Math.min(start + batchSize, list.size());
        if (start >= end) {
            return null;
        }
        return list.subList(start, end);
    }
606007
def split_into(max_num_chunks, list_to_chunk):
    
    max_chunk_size = math.ceil(len(list_to_chunk) / max_num_chunks)
    return chunks_of(max_chunk_size, list_to_chunk)
464333
def minibatch(items, size=8):
    
    if isinstance(size, int):
        size_ = itertools.repeat(size)
    else:
        size_ = size
    items = iter(items)
    while True:
        batch_size = next(size_)
        batch = list(itertools.islice(items, int(batch_size)))
        if len(batch) == 0:
            break
        yield list(batch)
1064558
def chunks(container, n):
    
    for i in range(0, len(container), n):
        yield container[i : i + n]
1196588
def iter_chunks(chunksize, *iterables):
    """"""
    iterables = iter(zip(*iterables))

    while 1:
        chunk = tuple(islice(iterables, chunksize))

        if not chunk:
            return

        yield chunk
367095
public function batch($size)
    {
        $chunks = array_chunk($this->items, $size, true);

        $list = [];
        foreach ($chunks as $chunk) {
            $list[] = new static($chunk, $this->params, $this->pages);
        }

        return $list;
    }
174879
public function chunk(int $size): CollectionInterface
    {
        if ($size <= 0) {
            return new static();
        }

        $chunks = [];

        foreach (array_chunk($this->data->getValues(), $size, true) as $chunk) {
            $chunks[] = new static($chunk);
        }

        return new static($chunks);
    }
627268
def ichunks_list(list_, chunksize):
    
    return (list_[ix:ix + chunksize] for ix in range(0, len(list_), chunksize))
819035
def chunks(l, n):
    
    for i in _range(0, len(l), n):
        yield l[i:i + n]
990728
public function chunk(int $size, bool $preserveKeys = false): ArrayCollection
    {
        $chunks = [];

        foreach (array_chunk($this->items, $size, $preserveKeys) as $chunk) {
            $chunks[] = new static($chunk);
        }

        return new static($chunks);
    }
177266
public static List<boolean[]> split(final boolean[] a, final int size) {
        if (size < 1) {
            throw new IllegalArgumentException("The parameter 'size' can not be zero or less than zero");
        }

        if (N.isNullOrEmpty(a)) {
            return new ArrayList<>();
        }

        final int len = a.length;
        final List<boolean[]> res = new ArrayList<>(len % size == 0 ? len / size : (len / size) + 1);

        for (int from = 0, toIndex = a.length; from < toIndex; from += size) {
            res.add(copyOfRange(a, from, from <= toIndex - size ? from + size : toIndex));
        }

        return res;
    }
67855
def chunks(self, chunk_size=None):
        
        if not chunk_size:
            chunk_size = self.DEFAULT_CHUNK_SIZE

        try:
            self.seek(0)
        except (AttributeError, UnsupportedOperation):
            pass

        while True:
            data = self.read(chunk_size)
            if not data:
                break
            yield data
182338
def _chunk_list(l, n):
    """"""
    for i in range(0, len(l), n):
        yield l[i:i + n]
567975
def chunks(l, n):
    """"""
    if n:
        for i in xrange(0, len(l), n):
            yield l[i:i + n]