def METHOD_NAME(
    op: str,
    got_version: Optional[str],
    want_version: Optional[str],
    requirement: str,
    package: str,
    func_name: Optional[str],
):
    if got_version is None or want_version is None:
        raise ValueError(
            f"Unable to compare versions for {requirement}: need={want_version} found={got_version}. This is unusual. Consider"
            f" reinstalling {package}."
        )
    if not ops[op](version.parse(got_version), version.parse(want_version)):
        raise ImportError(
            f"{requirement} must be installed{f' to use `{func_name}`' if func_name else ''}, but found {package}=={got_version}."
            f" You can install a supported version of '{package}' with this command: `pip install -U {requirement}`"
        )