close to chunk size
186881
function getTransfers(queue) {
    var transfers = [];
    var fnArray = queue.fnArray, argsArray = queue.argsArray;
    for (var i = 0, ii = queue.length; i < ii; i++) {
      switch (fnArray[i]) {
        case OPS.paintInlineImageXObject:
        case OPS.paintInlineImageXObjectGroup:
        case OPS.paintImageMaskXObject:
          var arg = argsArray[i][0]; // first param in imgData
          if (!arg.cached) {
            transfers.push(arg.data.buffer);
          }
          break;
      }
    }
    return transfers;
  }
1268188
def chunks(arr, size):
    
    for i in _range(0, len(arr), size):
        yield arr[i:i+size]
606355
def _PartitionChunks(chunks):
  """"""
  partitions = [[]]
  partition_size = 0

  for chunk in chunks:
    cursize = len(chunk["blob_chunk"])
    if (cursize + partition_size > BLOB_CHUNK_SIZE or
        len(partitions[-1]) >= CHUNKS_PER_INSERT):
      partitions.append([])
      partition_size = 0
    partitions[-1].append(chunk)
    partition_size += cursize

  return partitions
1243626
def chunks(iterable, size=50):
    """"""
    batch = []
    for n in iterable:
        batch.append(n)
        if len(batch) % size == 0:
            yield batch
            batch = []
    if batch:
        yield batch
369213
def get_chunk(self):
        """"""
        while not self._eof_reached:
            read = self.input_stream.read(self.chunk_size - len(self._partial_chunk))
            if len(read) == 0:
                self._eof_reached = True
            self._partial_chunk += read
            if len(self._partial_chunk) == self.chunk_size or self._eof_reached:
                chunk = self._partial_chunk
                self._partial_chunk = ""
                return chunk
700352
function chunk(start, end) {
                // Slice, unescape and push onto result array.
                res.push(str.slice(start, end).replace(/\\\\/g, '\\').replace(/\\\./g, '.'));
                // Set starting position of next chunk.
                pos = end + 1;
            }
451178
def extract_chunks(blob):
    """"""
    chunks = []
    stream = BytesIO(blob.bytes)
    current_pos = stream.tell()
    stream.seek(0, 2)
    length = stream.tell()
    stream.seek(current_pos, 0)
    while stream.tell() < length:
        chunks.append(read_chunk(stream))

    return chunks
760622
def chunks(lista, size):
    """"""
    if not isinstance(lista, list):
        logger.error('Erron in chunks, arg introduced is not a list.', lista=lista)
        return lista

    for i in range(0, len(lista), size):
        yield lista[i:i + size]
39203
def chunks(iterable, size = 8):
	
	for i in range(0, len(iterable), size):
		yield l[i:i + n]
306284
def _adjust_chunk_size(self, options):
        # type: (Descriptor, blobxfer.models.options.Upload) -> None
        
        chunk_size = options.chunk_size_bytes
        # auto-select chunk size
        if chunk_size == 0:
            if self._ase.mode != blobxfer.models.azure.StorageModes.Block:
                chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
            else:
                if self._ase.size == 0:
                    chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                else:
                    chunk_size = _DEFAULT_AUTO_CHUNKSIZE_BYTES
                    while chunk_size < _MAX_BLOCK_BLOB_CHUNKSIZE_BYTES:
                        chunks = int(math.ceil(self._ase.size / chunk_size))
                        if chunks <= _MAX_NUM_CHUNKS:
                            break
                        chunk_size = chunk_size << 1
            if self._verbose:
                logger.debug(
                    'auto-selected chunk size of {} for {}'.format(
                        chunk_size, self.local_path.absolute_path))
        if self.local_path.use_stdin:
            self._chunk_size = max(
                (chunk_size, _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES)
            )
        else:
            self._chunk_size = min((chunk_size, self._ase.size))
        # ensure chunk sizes are compatible with mode
        if self._ase.mode == blobxfer.models.azure.StorageModes.Append:
            if self._chunk_size > _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES:
                self._chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                if self._verbose:
                    logger.debug(
                        ('adjusting chunk size to {} for append blob '
                         'from {}').format(
                             self._chunk_size, self.local_path.absolute_path))
        elif self._ase.mode == blobxfer.models.azure.StorageModes.Block:
            if (not self.local_path.use_stdin and
                    self._ase.size <= options.one_shot_bytes):
                self._chunk_size = min(
                    (self._ase.size, options.one_shot_bytes)
                )
            else:
                if self._chunk_size > _MAX_BLOCK_BLOB_CHUNKSIZE_BYTES:
                    self._chunk_size = _MAX_BLOCK_BLOB_CHUNKSIZE_BYTES
                    if self._verbose:
                        logger.debug(
                            ('adjusting chunk size to {} for block blob '
                             'from {}').format(
                                self._chunk_size,
                                 self.local_path.absolute_path))
        elif self._ase.mode == blobxfer.models.azure.StorageModes.File:
            if self._chunk_size > _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES:
                self._chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                if self._verbose:
                    logger.debug(
                        'adjusting chunk size to {} for file from {}'.format(
                            self._chunk_size, self.local_path.absolute_path))
        elif self._ase.mode == blobxfer.models.azure.StorageModes.Page:
            if self._ase.size > _MAX_PAGE_BLOB_SIZE:
                raise RuntimeError(
                    '{} size {} exceeds maximum page blob size of {}'.format(
                        self.local_path.absolute_path, self._ase.size,
                        _MAX_PAGE_BLOB_SIZE))
            if self._chunk_size > _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES:
                self._chunk_size = _MAX_NONBLOCK_BLOB_CHUNKSIZE_BYTES
                if self._verbose:
                    logger.debug(
                        ('adjusting chunk size to {} for page blob '
                         'from {}').format(
                             self._chunk_size, self.local_path.absolute_path))
554887
def chunks(iterable, size=1):
    """"""
    iterator = iter(iterable)

    for element in iterator:
        yield chain([element], islice(iterator, size - 1))
717261
def _chunks(l, n):
    
    for i in xrange(0, len(l), n):
        yield l[i:i+n]
328626
def _chunk_length(self, data):
        """"""

        assert data[-2:] == "\r\n", "CRLF"

        length = data[:-2].split(';')[0] # cut off optional length paramters
        length = int(length.strip(), 16) # length is in hex

        if length:
            logger.debug('Got chunk length: %d', length)
            self.httpstream.read_bytes(length + 2, self._chunk_data)
        else:
            logger.debug('Got last chunk (size 0)')
            self.got_request = True
            # enable input write event so the handler can finish things up 
            # when it has written all pending data
            self.ioloop.update_handler(self.fd_stdin, self.ioloop.WRITE | self.ioloop.ERROR)
975444
private byte[] requestChunk(int requestedSize)
	{
		mPosInChunk = 0;
		if (mCurrentChunkIndex++ < mChunkList.size() - 1)
		{
			// there is one more unused buffer in the list, return it
			return mCurrentChunk = mChunkList.get(mCurrentChunkIndex);
		}

		mChunkList.add(mCurrentChunk = new byte[Math.max(requestedSize, mMinChunkSize)]);
		return mCurrentChunk;
	}
751731
function cut(buffer, size) {
  var chunks = [];
  var cursor = 0;
  do {
    var chunkSize = Math.min(size, buffer.length - cursor);
    chunks.push(buffer.slice(cursor, cursor + chunkSize));
    cursor += chunkSize;
  } while(cursor < buffer.length);
  return chunks;
}
375098
def _chunks(l, ncols):
    """"""
    assert isinstance(ncols, int), "ncols must be an integer"
    for i in range(0, len(l), ncols):
        yield l[i: i+ncols]
1199140
def chunks(stream, chunk_size, output_type=tuple):
    '''  '''
    assert iterable(stream), 'chunks needs stream to be iterable'
    assert (isinstance(chunk_size, int) and chunk_size > 0) or callable(chunk_size), 'chunks needs chunk_size to be a positive int or callable'
    assert callable(output_type), 'chunks needs output_type to be callable'
    if callable(chunk_size):
        ''' chunk_size is acting as a separator function '''
        for chunk in chunk_on(stream, chunk_size, output_type):
            yield chunk
    else:
        it = iter(stream)
        marker = object()
        iters = [it] * chunk_size
        pipeline = apply_to_last(
           zip_longest(*iters, fillvalue=marker),
           lambda last_chunk: tuple(i for i in last_chunk if i is not marker)
        )
        if output_type is not tuple:
            pipeline = map(output_type, pipeline)
        for chunk in pipeline:
            yield chunk