MCPcopy Create free account
hub / github.com/Speakn0w/RealChart2Code / find_task_files

Function find_task_files

RealChart2Code_eval/evaluate_task3.py:70–96  ·  view source on GitHub ↗
(data_dir: Path, difficulty: str = None)

Source from the content-addressed store, hash-verified

68
69
70def find_task_files(data_dir: Path, difficulty: str = None) -> List[Path]:
71
72 task_files = []
73
74 for dir_path in data_dir.iterdir():
75 if not dir_path.is_dir():
76 continue
77
78
79 if not any(dir_path.glob("task_*.json")):
80 continue
81
82
83 difficulties = [difficulty] if difficulty else ["simple", "middle", "hard"]
84
85 for diff in difficulties:
86
87 standard_task = dir_path / f"task_{diff}_data.json"
88 if standard_task.exists():
89 task_files.append(standard_task)
90
91
92 multi_task = dir_path / f"task_{diff}_mul_data.json"
93 if multi_task.exists():
94 task_files.append(multi_task)
95
96 return task_files
97
98
99def parse_task_file(task_file: Path) -> Tuple[str, str, List[str]]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected