Yield successive EVENT_SIZE sized chunks from raw.
171728
def chunks(raw):
    """"""
    for i in range(0, len(raw), EVENT_SIZE):
        yield struct.unpack(EVENT_FORMAT, raw[i:i+EVENT_SIZE])
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
1142755
def read_next_block(infile, block_size=io.DEFAULT_BUFFER_SIZE):
    """"""
    chunk = infile.read(block_size)

    while chunk:
        yield chunk

        chunk = infile.read(block_size)
407598
def _chunk_offsets(self):
        """"""
        index = 0
        blob_size = self.blob_properties.get('content-length')
        while index < blob_size:
            yield index
            index = index + self._chunk_size
364527
def get_chunks(source, chunk_len):
    
    return (source[i: i + chunk_len] for i in range(0, len(source), chunk_len))
1353914
def batch(items, size):
    """"""
    return [items[x:x + size] for x in xrange(0, len(items), size)]
1196588
def iter_chunks(chunksize, *iterables):
    """"""
    iterables = iter(zip(*iterables))

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

        if not chunk:
            return

        yield chunk
1112883
def chunks(some_list: List, n: int) -> Iterable[List]:
    """"""
    for i in range(0, len(some_list), n):
        yield some_list[i:i + n]
784233
async def iter_chunks(self, chunk_size=_DEFAULT_CHUNK_SIZE):
        
        while True:
            current_chunk = await self.read(chunk_size)
            if current_chunk == b"":
                break
            await yield_(current_chunk)
1079404
def chunk_sequence(sequence, chunk_length):
    """"""
    for index in range(0, len(sequence), chunk_length):
        yield sequence[index:index + chunk_length]
733240
def chunks(l, n):
    
    newn = int(len(l) / n)
    for i in xrange(0, n-1):
        yield l[i*newn:i*newn+newn]
    yield l[n*newn-newn:]
238953
def chunks(seq, size):
    
    return (seq[pos:pos + size] for pos in range(0, len(seq), size))
1104534
def chunk(iterable, size):
    
    # TODO: only used in gui.mainwindow(deprecated)
    iterator = iter(iterable)
    while size:
        result = []
        try:
            for i in range(size):
                elem = next(iterator)
                result.append(elem)
            yield tuple(result)
        except StopIteration:
            if result:
                yield tuple(result)
            return
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
902216
def chunks(l, n):
    
    newn = int(1.0 * len(l) / n + 0.5)
    for i in range(0, n - 1):
        yield l[i * newn:i * newn + newn]
    yield l[n * newn - newn:]
1000715
def file_chunk(filename, size=_BUFFERING):
    

    def chunks():
        with open(filename, "rb", _BUFFERING) as fd:
            buf = fd.read(size)
            while buf:
                yield buf
                buf = fd.read(size)
    return chunks
1078548
def chunks(data, size):
    
    for i in range(0, len(data), size):
        yield data[i:i + size]