def trace_history(history, idx):
    """ Determine all labels applied to an individual of interest (idx) through time.

    Return a list of all labels applied to an individual of interest through time.
    Search through each label dictionary and check if the individual is included there.

    Args:
        history (List[int]): Indexes are keyed to sample idexes. Contains a dictionary of labels.
        idx (int): The index associated with the individual of interest.

    Returns:
        List[labels]: List of labels applied. Label type deteremined by history
        List[int]: Time indexes corresponding to samples taken.

    """

    labels_applied = []  # what label was applied? 0,1, or 2?
    times = []  # store the indexes where we found the sample
    for labeldict, num_slice in zip(history, range(len(history))):
        # Loop over list of histories (dicts)
        for index in labeldict.keys():
            if idx in labeldict[index]:
                labels_applied.append(index)
                times.append(num_slice)
    return labels_applied, times