from typing import List
from typing import Any


def remove_duplicates_in_order(list: List[Any]) -> List[Any]:
    """
    Remove duplicates in a list, keeping the first occurrence and preserving order.

    Parameters
    ----------
        list: input list

    Returns
    -------
        deduplicated list
    """

    # see https://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-whilst-preserving-order
    seen = set()
    seen_add = seen.add
    return [x for x in list if not (x in seen or seen_add(x))]