def uniq(seq):
    """Return unique elements in the input collection, preserving the order.

    :param seq: sequence to filter
    :return: sequence with duplicate items removed
    """
    seen = set()
    return [x for x in seq if not (x in seen or seen.add(x))]