| 518 | return patch |
| 519 | |
| 520 | def find_matching_abs_path(parent_folder, sub_path): |
| 521 | # Walk through the parent folder to find matching sub-path |
| 522 | for root, dirs, files in os.walk(parent_folder): |
| 523 | for name in dirs + files: |
| 524 | full_path = os.path.join(root, name) |
| 525 | # Check if the sub_path matches the end of the full path |
| 526 | if full_path.endswith(sub_path): |
| 527 | return os.path.abspath(full_path) |
| 528 | return None |
| 529 | |
| 530 | def find_all_file_paths(parent_folder, file_name): |
| 531 | """Finds all paths of files with the given name in a parent folder. |