def METHOD_NAME(ws_path, subj_type, act_type, slot_type):
    lists = Lists(ws_path, None)
    spairs = get_subject_pairs(subj_type, lists)
    act_repo = lists.activities[act_type]
    slots = lists.slots[slot_type]
    rs = {}
    for spair in spairs:
        for tid, template in enumerate(slots):
            for act_type, act_ls in act_repo.items():
                if act_type in template or act_type[:-1]+':' in template:   # e.g. if "[p_act]" or "[p_act:" in template
                    for act_row in act_ls:
                        t = template
                        for head, act in act_row.items():
                            unique_act = act_row['unique']
                            act_cluster = act_row['cluster']
                            t = t.replace(head, act)
                        mapping = SubjSlotMapping(tid, unique_act, act_cluster, spair, t, act)
                        rs[mapping.key] = mapping
    return rs