(iterable, key=None)
Return an iterator over unique elements of `iterable` preserving order.

    If `key` is supplied it is used as a substitute for determining
    'uniqueness' of elements.

    Parameters
    ----------
    iterable : Iterable[T]
    key : Callable[[T], Hashable]

    Returns
    -------
    unique : Iterable[T]
Return an iterator over unique elements of `iterable` preserving order.
Return an iterator over unique elements of iterable preserving order .
def unique_everseen(iterable, key=None):
    # type: (Iterable[_T1], Optional[Callable[[_T1], Hashable]]) -> Iterable[_T1]
    """
    Return an iterator over unique elements of `iterable` preserving order.

    If `key` is supplied it is used as a substitute for determining
    'uniqueness' of elements.

    Parameters
    ----------
    iterable : Iterable[T]
    key : Callable[[T], Hashable]

    Returns
    -------
    unique : Iterable[T]
    """
    seen = set()
    if key is None:
        key = lambda t: t
    for el in iterable:
        el_k = key(el)
        if el_k not in seen:
            seen.add(el_k)
            yield el
def unique_everseen ( iterable , key = None ) : # type: (Iterable[_T1], Optional[Callable[[_T1], Hashable]]) -> Iterable[_T1] seen = set ( ) if key is None : key = lambda t : t for el in iterable : el_k = key ( el ) if el_k not in seen : seen . add ( el_k ) yield el