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

Function replace_path_generic

RealChart2Code_eval/evaluate_task2.py:299–309  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

297
298
299 def replace_path_generic(match):
300 start_quote = match.group(1)
301 original_path = match.group(2)
302 end_quote = match.group(3)
303
304 if Path(original_path).is_absolute():
305 return match.group(0)
306
307 absolute_path = data_directory / original_path
308
309 return f"r'{absolute_path}'"
310
311 processed_code = code_content
312 for pattern in patterns:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected