def METHOD_NAME(name: str, pbench_run: Optional[str] = None) -> Path:
    """verify_tool_group - given a tool group name, verify it exists in the
    ${pbench_run} directory as a properly prefixed tool group directory
    name.
    Raises a BadToolGroup exception if the directory is invalid or does not
    exist, or if the pbench_run argument is None and the environment
    variable of the same name is missing.
    Returns a Pathlib object of the tool group directory on success.
    """
    _pbench_run = os.environ.get("pbench_run") if pbench_run is None else pbench_run
    if not _pbench_run:
        raise BadToolGroup(
            f"Cannot validate tool group, '{name}', 'pbench_run'"
            " environment variable missing"
        )
    tg_dir_name = Path(_pbench_run, f"{ToolGroup.TOOL_GROUP_PREFIX}-{name}")
    try:
        tg_dir = tg_dir_name.resolve(strict=True)
    except FileNotFoundError:
        raise BadToolGroup(
            f"Bad tool group, '{name}': directory {tg_dir_name} does not exist"
        )
    except Exception as exc:
        raise BadToolGroup(
            f"Bad tool group, '{name}': error resolving {tg_dir_name} directory"
        ) from exc
    else:
        if not tg_dir.is_dir():
            raise BadToolGroup(
                f"Bad tool group, '{name}': directory {tg_dir_name} not valid"
            )
        else:
            return tg_dir