import pathlib


def _excluded(pathobj: pathlib.Path) -> bool:
    """
    Exclude certain directories or filenames from being found:

    if directory: x.as_posix().startswith()
    if filename: x.name.startswith()

    """
    return any((
        pathobj.as_posix().startswith('venv'),
        pathobj.as_posix().startswith('virtualenv'),
    ))