def filter_candidates(candidates: list, usr_input: str):
    """
    Return entries in candidates that contain usr_input as substring, ordered by the index
    where the substring is found. Duplicates are removed. For matches where the index of 
    the substring is the same, original order (time) is kept.
    """
    with_dups = list(sorted(filter(lambda x: usr_input in x, candidates), key=lambda x: x.find(usr_input)))
    seen = set()
    return [x for x in with_dups if not (x in seen or seen.add(x))]