import pathlib
from typing import List


def _get_all_directories(root: pathlib.Path) -> List[pathlib.Path]:
    """Walk the directory tree and return all the folders."""
    all_files_and_folders = root.glob("**/*")
    return [path for path in all_files_and_folders if path.is_dir()]