MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / split_sequence

Method split_sequence

join/LSH/datasketch/storage.py:445–458  ·  view source on GitHub ↗

Generator to split an iterable in chunks of given size. :param iterable iterable: the iterable to split :param int size: the size of a chunk :rtype: generator[iterable] :return: a generator

(iterable, size)

Source from the content-addressed store, hash-verified

443
444 @staticmethod
445 def split_sequence(iterable, size):
446 """
447 Generator to split an iterable in chunks of given size.
448
449 :param iterable iterable: the iterable to split
450 :param int size: the size of a chunk
451 :rtype: generator[iterable]
452 :return: a generator
453 """
454 iterator = iter(iterable)
455 item = list(itertools.islice(iterator, size))
456 while item:
457 yield item
458 item = list(itertools.islice(iterator, size))
459
460 def _select(self, statements_and_parameters):
461 """

Callers 2

_selectMethod · 0.80
_executeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected