Recursively strip /workspace/ prefix from path values in results.
(obj)
| 77 | |
| 78 | |
| 79 | def _strip_workspace_prefix(obj): |
| 80 | """Recursively strip /workspace/ prefix from path values in results.""" |
| 81 | if isinstance(obj, dict): |
| 82 | return { |
| 83 | k: _strip_path_value(v) if _is_path_key(k) else _strip_workspace_prefix(v) |
| 84 | for k, v in obj.items() |
| 85 | } |
| 86 | elif isinstance(obj, list): |
| 87 | return [_strip_workspace_prefix(item) for item in obj] |
| 88 | return obj |
| 89 | |
| 90 | |
| 91 | # Approximate chars-per-token used for budget conversion. |
no test coverage detected