def METHOD_NAME(candidate_paths: Set[Path]) -> Set[Path]:
    existent_directories: Set[Path] = set()
    for path in candidate_paths:
        try:
            if path.exists():
                existent_directories.add(path)
        except OSError as exc:
            if exc.errno != errno.ENAMETOOLONG:
                raise exc
    non_existent_directories: Set[Path] = candidate_paths - existent_directories
    if non_existent_directories:
        warn(
            "WARNING: The following directories listed in your path were found to "
            f"be non-existent: {non_existent_directories}"
        )
    return existent_directories