def previous_current_next(items):
    extend = itertools.chain([None], items, [None])
    previous, current, next = itertools.tee(extend, 3)
    try:
        current.next()
        next.next()
        next.next()
    except StopIteration:
        pass
    return itertools.izip(previous, current, next)
Only one host for now.
dataset/ETHPy150Open fabiocorneti/django-easytree/easytree/templatetags/easytree_tags.py/previous_current_next--crossover with--dataset/ETHPy150Open Net-ng/kansha/kansha/services/search/elasticengine.py/ElasticSearchEngine.__init__