def METHOD_NAME(path_to_exe: Path) -> bool:
    if path_to_exe.parent == Path("."):
        executable = shutil.which(path_to_exe.stem)
        if executable is None:
            return False
    else:
        executable = path_to_exe
    return os.access(executable, os.X_OK)