I hereby claim:
- I am shpigunov on github.
- I am shpigunov (https://keybase.io/shpigunov) on keybase.
- I have a public key ASCtXFSaFxZG16ocragMYrfUZSyCBlE_zdxU1B5qjwlfIwo
To claim this, I am signing this object:
""" | |
This is a study on the fastest way to split an iteralbe (list) into batches of a set size. | |
Note that this study omits attempts parallelization and does not use generators. | |
""" | |
from typing import List | |
from itertools import islice | |
def batch(iterable: List, batch_size: int) -> List[List]: | |
res = [] |
def write_bin(s): | |
return ' '.join(format(ord(x), 'b') for x in s) | |
def read_bin(s): | |
return ''.join([chr(int(c, 2)) for c in s.split()]) | |
read_bin("01010100 01110101 01100101 01110011 01100100 01100001 01111001") | |
write_bin("Tuesday") |
I hereby claim:
To claim this, I am signing this object: