from typing import OrderedDict


def resource_prep(times, col, stop=0):
    """
    Counts values of col and assigns to work_item
    :param times: Dataframe with calculated times
    :param col: Column name to count for
    :param stop: stop criteria
    :return: Dict of structure {work_item: col_values}
    """
    processes = OrderedDict()
    for wi in times["work_item"].unique():
        vals = times[times["work_item"] == wi][col].unique()
        processes[wi] = vals
        if stop > 0:
            stop -= 1
            if stop == 0:
                break
    return processes