def wip_task(task_tuple, top_level_dict, task_data_dict):
    """ Updates relevant wip data dictionary """

    task_data_dict["date_time"].append(get_timestamp())
    department = task_tuple[0].split("_")[0]
    for machine_code in create_machine_code(top_level_dict, department):
        worker_wip_dict = worker_wip(machine_code)
        for data_point in task_data_dict[machine_code]:
            task_data_dict[machine_code][data_point].append(worker_wip_dict[data_point])

    return task_data_dict
def wip_task(task_tuple, top_level_dict, task_data_dict):
    """ Updates relevant wip data dictionary """

    task_data_dict['date_time'].append(get_timestamp())
    department = task_tuple[0].split('_')[0]
    for machine_code in create_machine_code(top_level_dict, department):
        worker_wip_dict = worker_wip(machine_code)
        for data_point in task_data_dict[machine_code]:
            task_data_dict[machine_code][data_point].append(
                worker_wip_dict[data_point])

    return task_data_dict
def id_daily_routine(file_prefix, top_level_dict):
    """ Function that controls the id daily_routine"""
    # I worry that this is not very elegant, and I have not yet been able to test it. The idea
    # is that this function controls the entire routine of worker id. In particular I worry
    # about all of the functions calling other functions as part of this routine. It seems like
    # the complexity might make the program hard to debug.

    daily_file = locate_most_recent(file_prefix + "_id")
    if daily_file is None:
        return populate_id_dict(create_id_dicts(top_level_dict, file_prefix), daily_file, top_level_dict, file_prefix)
    if get_timestamp()[:10] not in daily_file:
        return populate_id_dict(create_id_dicts(top_level_dict, file_prefix), daily_file, top_level_dict, file_prefix)
    else:
        return open_json(daily_file, None, None)
def id_daily_routine(file_prefix, top_level_dict):
    """ Function that controls the id daily_routine"""
    # I worry that this is not very elegant, and I have not yet been able to test it. The idea
    # is that this function controls the entire routine of worker id. In particular I worry
    # about all of the functions calling other functions as part of this routine. It seems like
    # the complexity might make the program hard to debug.

    daily_file = locate_most_recent(file_prefix + '_id')
    if daily_file is None:
        return populate_id_dict(create_id_dicts(top_level_dict, file_prefix),
                                daily_file, top_level_dict, file_prefix)
    if get_timestamp()[:10] not in daily_file:
        return populate_id_dict(create_id_dicts(top_level_dict, file_prefix),
                                daily_file, top_level_dict, file_prefix)
    else:
        return open_json(daily_file, None, None)