def METHOD_NAME(project_root: Path) -> Path | None:
    assert project_root.is_dir()
    custom_paths: dict[str, str | None] = global_settings.get(
        "python_venvs", Dict[str, Optional[str]]
    )
    if str(project_root) in custom_paths:
        path_string = custom_paths[str(project_root)]
        if path_string is None:
            log.info(f"user has unselected venv for {project_root}")
            return None
        from_settings = Path(path_string)
        if is_venv(from_settings):
            return from_settings
        log.warning(f"Python venv is no longer valid: {from_settings}")
        del custom_paths[str(project_root)]
        global_settings.set("python_venvs", custom_paths)  # custom_paths is copy
    result = _find_venv(project_root)
    if result is None:
        log.info(f"No venv found in {project_root}")
    else:
        set_venv(project_root, result)
    return result