Fix issue #131
This commit is contained in:
parent
4ef32a5653
commit
d87f2ec37d
@ -169,7 +169,10 @@ def batch(iterable, size):
|
|||||||
sourceiter = iter(iterable)
|
sourceiter = iter(iterable)
|
||||||
while True:
|
while True:
|
||||||
batchiter = itertools.islice(sourceiter, size)
|
batchiter = itertools.islice(sourceiter, size)
|
||||||
|
try:
|
||||||
yield itertools.chain([next(batchiter)], batchiter)
|
yield itertools.chain([next(batchiter)], batchiter)
|
||||||
|
except StopIteration:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def is_within_interval(value, min_value=None, max_value=None):
|
def is_within_interval(value, min_value=None, max_value=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user