MCPcopy
hub / github.com/evalplus/evalplus / gather_solutions

Function gather_solutions

tools/collect_valid_solutions.py:92–105  ·  view source on GitHub ↗

Gather all solutions from the folders

(sample_path: str, task_id: str)

Source from the content-addressed store, hash-verified

90
91
92def gather_solutions(sample_path: str, task_id: str) -> List[str]:
93 """Gather all solutions from the folders"""
94 solutions = []
95 for model in os.listdir(sample_path):
96 model_path = os.path.join(sample_path, model)
97 if not os.path.isdir(model_path):
98 continue
99 task_path = os.path.join(model_path, task_id)
100 if os.path.isdir(task_path):
101 for file in os.listdir(task_path):
102 if file.endswith(".py"):
103 with open(os.path.join(task_path, file), "r") as f:
104 solutions.append(f.read())
105 return solutions
106
107
108def deduplicate(solutions: List[str]) -> List[str]:

Callers 1

scriptFunction · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected