def to_linkedlist(iterable):
    prevs, items, nexts = tee(iterable, 3)
    prevs = chain([None], prevs)
    nexts = chain(islice(nexts, 1, None), [None])
    return zip(prevs, items, nexts)
Convert iterable into (prev, current, next) triplets
dataset/ETHPy150Open jsmesami/naovoce/src/utils/__init__.py/to_linkedlist