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

Function find_data_files

RealChart2Code_eval/evaluate_task2.py:118–134  ·  view source on GitHub ↗
(directory: Path, filenames: List[str])

Source from the content-addressed store, hash-verified

116
117
118def find_data_files(directory: Path, filenames: List[str]) -> Dict[str, Path]:
119
120 found_files = {}
121
122 def search_recursive(search_dir: Path, depth: int = 0):
123 if depth > 5:
124 return
125
126 for item in search_dir.iterdir():
127 if item.is_file() and item.suffix.lower() in ['.csv', '.xlsx']:
128 if item.name in filenames:
129 found_files[item.name] = item
130 elif item.is_dir() and not item.name.startswith('.'):
131 search_recursive(item, depth + 1)
132
133 search_recursive(directory)
134 return found_files
135
136
137def diagnose_task_file_issues(task_file: Path) -> Dict[str, any]:

Callers 2

prepare_task_infoFunction · 0.70

Calls 1

search_recursiveFunction · 0.70

Tested by

no test coverage detected