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

Function replace_path_generic

RealChart2Code_eval/evaluate_task1.py:307–317  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

305
306
307 def replace_path_generic(match):
308 start_quote = match.group(1)
309 original_path = match.group(2)
310 end_quote = match.group(3)
311
312 if Path(original_path).is_absolute():
313 return match.group(0)
314
315 absolute_path = data_directory / original_path
316
317 return f"r'{absolute_path}'"
318
319 processed_code = code_content
320 for pattern in patterns:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected