21 lines
313 B
Python
Executable file
21 lines
313 B
Python
Executable file
#!/usr/bin/env python
|
|
|
|
|
|
from math import log2
|
|
from qas_flow import Stream
|
|
|
|
|
|
def gen():
|
|
n = 0
|
|
while True:
|
|
yield n
|
|
n += 1
|
|
|
|
|
|
def mapfunc(ix):
|
|
i, x = ix
|
|
return str(x) * int(log2(i + 1))
|
|
|
|
|
|
strm = Stream(gen())
|
|
print(strm.enumerate().map(mapfunc).skip(20).take(4).enumerate().collect())
|