def public_modules(path):
    """Yield all the paths to public modules in a given directory."""
    for entry in path.iterdir():
        if entry.name.startswith('_'):
            continue
        if entry.is_dir() or entry.is_file() and entry.suffix == '.py':
            yield entry
