MCPcopy Index your code
hub / github.com/evalplus/evalplus / parallel_greedy_cover

Function parallel_greedy_cover

tools/tsr/minimization.py:72–96  ·  view source on GitHub ↗
(
    info_dict: Optional[Dict[str, Dict[str, List[Any]]]],
    exclude_model: str,
    type: str,
    **kwargs,
)

Source from the content-addressed store, hash-verified

70
71
72def parallel_greedy_cover(
73 info_dict: Optional[Dict[str, Dict[str, List[Any]]]],
74 exclude_model: str,
75 type: str,
76 **kwargs,
77) -> Dict[str, List[str]]:
78 plus_tests = {task_id: [] for task_id in task_ids}
79
80 with ProcessPoolExecutor(max_workers=32) as executor:
81 futures = []
82 for task_id in task_ids:
83 if type == "sample":
84 path_task_id = to_path(task_id)
85 sample_dir = kwargs["sample_dir"]
86 with open(os.path.join(sample_dir, f"{path_task_id}.pkl"), "rb") as f:
87 td = pickle.load(f)
88 args = (task_id, td, exclude_model)
89 else:
90 args = (task_id, info_dict[task_id], exclude_model)
91 futures.append(executor.submit(greedy_cover, *args))
92 for future in track(as_completed(futures), f"min set cover :: {type}"):
93 task_id, min_cover = future.result()
94 plus_tests[task_id] = min_cover
95
96 return plus_tests
97
98
99#####################

Callers 3

get_coverage_set_coverFunction · 0.85
get_mutation_set_coverFunction · 0.85
get_sample_set_coverFunction · 0.85

Calls 1

to_pathFunction · 0.90

Tested by

no test coverage detected