def get_common_excludes() -> List[Path]:
    'Find commonly excluded directories, and return them as a [Path]'
    exclude_list: List[Path] = []
    typical_ignored_directories: List[str] = ['.environment', '.presubmit', '.git', '.mypy_cache', '.cargo', 'environment', 'out']
    pw_root_dir = Path(os.environ['PW_ROOT'])
    exclude_list.extend(((pw_root_dir / ignored_directory) for ignored_directory in typical_ignored_directories))
    pw_project_root_dir = Path(os.environ['PW_PROJECT_ROOT'])
    if (pw_project_root_dir != pw_root_dir):
        exclude_list.extend(((pw_project_root_dir / ignored_directory) for ignored_directory in typical_ignored_directories))
    legacy_directories = ['.cipd', '.python3-venv']
    found_legacy = False
    for legacy_directory in legacy_directories:
        full_legacy_directory = (pw_root_dir / legacy_directory)
        if full_legacy_directory.is_dir():
            _LOG.warning('Legacy environment directory found: %s', str(full_legacy_directory))
            exclude_list.append(full_legacy_directory)
            found_legacy = True
    if found_legacy:
        _LOG.warning('Found legacy environment directory(s); these should be deleted')
    return exclude_list
Find commonly excluded directories, and return them as a [Path]
def get_common_excludes() -> List[Path]:
    
    exclude_list: List[Path] = []
    typical_ignored_directories: List[str] = ['.environment', '.presubmit', '.git', '.mypy_cache', '.cargo', 'environment', 'out']
    pw_root_dir = Path(os.environ['PW_ROOT'])
    exclude_list.extend(((pw_root_dir / ignored_directory) for ignored_directory in typical_ignored_directories))
    pw_project_root_dir = Path(os.environ['PW_PROJECT_ROOT'])
    if (pw_project_root_dir != pw_root_dir):
        exclude_list.extend(((pw_project_root_dir / ignored_directory) for ignored_directory in typical_ignored_directories))
    legacy_directories = ['.cipd', '.python3-venv']
    found_legacy = False
    for legacy_directory in legacy_directories:
        full_legacy_directory = (pw_root_dir / legacy_directory)
        if full_legacy_directory.is_dir():
            _LOG.warning('Legacy environment directory found: %s', str(full_legacy_directory))
            exclude_list.append(full_legacy_directory)
            found_legacy = True
    if found_legacy:
        _LOG.warning('Found legacy environment directory(s); these should be deleted')
    return exclude_list