Open
Description
in utils.py
def previous_and_next(some_iterable):
prevs, items, nexts = tee(some_iterable, 3)
prevs = chain([None], prevs)
nexts = chain(islice(nexts, 1, None), [None])
return izip(prevs, items, nexts)
for work i use this fonction but they not work well because i use it in this loop
for gallery in dirs:
but dirs is not sort by date