def get_changed_packages(
    changed_files: list[Path], all_packages: list[Path]
) -> set[Path]:
    """Get the list of package folders containing the path in 'changed_files'."""
    changed_packages: set[Path] = set()

    for file_path in changed_files:
        # Find the package containing this file
        for pkg_dir in all_packages:
            if file_path.absolute().is_relative_to(pkg_dir.absolute()):
                changed_packages.add(pkg_dir)
                break

    return changed_packages
Get the list of package folders containing the path in 'changed_files'.
llama-dev/llama_dev/utils.py