def unique_flags(items, key=None):
len_ = len(items)<EOL>if key is None:<EOL><INDENT>item_to_index = dict(zip(reversed(items), reversed(range(len_))))<EOL>indices = item_to_index.values()<EOL><DEDENT>else:<EOL><INDENT>indices = argunique(items, key=key)<EOL><DEDENT>flags = boolmask(indices, len_)<EOL>return flags<EOL>
Returns a list of booleans corresponding to the first instance of each
unique item.

Args:
    items (Sequence): indexable collection of items

    key (Callable, optional): custom normalization function.
        If specified returns items where `key(item)` is unique.

Returns:
    List[bool] : flags the items that are unique

Example:
    >>> import ubelt as ub
    >>> items = [0, 2, 1, 1, 0, 9, 2]
    >>> flags = unique_flags(items)
    >>> assert flags == [True, True, True, False, False, True, False]
    >>> flags = unique_flags(items, key=lambda x: x % 2 == 0)
    >>> assert flags == [True, False, True, False, False, False, False]