mirror of
https://github.com/simon987/hexlib.git
synced 2025-04-10 14:06:43 +00:00
Add chunks()
This commit is contained in:
parent
52ad2d22b9
commit
fe955668eb
@ -9,6 +9,11 @@ import siphash
|
||||
last_time_called = dict()
|
||||
|
||||
|
||||
def chunks(lst: list, chunk_len: int):
|
||||
for i in range(0, len(lst), chunk_len):
|
||||
yield lst[i:i + chunk_len]
|
||||
|
||||
|
||||
def rate_limit(per_second):
|
||||
min_interval = 1.0 / float(per_second)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user