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

Function find_data_files

RealChart2Code_eval/evaluate_task3.py:125–141  ·  view source on GitHub ↗
(directory: Path, filenames: List[str])

Source from the content-addressed store, hash-verified

123
124
125def find_data_files(directory: Path, filenames: List[str]) -> Dict[str, Path]:
126
127 found_files = {}
128
129 def search_recursive(search_dir: Path, depth: int = 0):
130 if depth > 5:
131 return
132
133 for item in search_dir.iterdir():
134 if item.is_file() and item.suffix.lower() in ['.csv', '.xlsx']:
135 if item.name in filenames:
136 found_files[item.name] = item
137 elif item.is_dir() and not item.name.startswith('.'):
138 search_recursive(item, depth + 1)
139
140 search_recursive(directory)
141 return found_files
142
143
144def 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