def duplicates_justseen(iterable, key=None):
    """Yields serially-duplicate elements after their first appearance.

    >>> list(duplicates_justseen('mississippi'))
    ['s', 's', 'p']
    >>> list(duplicates_justseen('AaaBbbCccAaa', str.lower))
    ['a', 'a', 'b', 'b', 'c', 'c', 'a', 'a']

    This function is analagous to :func:`unique_justseen`.

    """
    return flatten(
        map(
            lambda group_tuple: islice_extended(group_tuple[1])[1:],
            groupby(iterable, key),
        )
    )
Yields serially-duplicate elements after their first appearance.

    >>> list(duplicates_justseen('mississippi'))
    ['s', 's', 'p']
    >>> list(duplicates_justseen('AaaBbbCccAaa', str.lower))
    ['a', 'a', 'b', 'b', 'c', 'c', 'a', 'a']

    This function is analagous to :func:`unique_justseen`.

    
product/runtime/src/main/python/pkg_resources/_vendor/more_itertools/more.py