macpie.itertools.duplicate_indices#

macpie.itertools.duplicate_indices(iterable)#

Make an iterator that returns duplicate items from the seq along with the the indices of that item.

>>> seq = ['a', 'b', 'c', 'b', 'd']
>>> dups = duplicate_indices(seq)
>>> next(dups)
('b', [1, 3])