def require ( executable : str , explanation : str = "" ) -> None : assert shutil . which ( executable ) , "Need {!r} on the PATH.{}" . format ( executable , "\n" + explanation if explanation else "" )
python assert command not found
Ensures that the external tool is available . Asserts upon failure .
def require(executable: str, explanation: str = "") -> None:
    """
    Ensures that the external tool is available.
    Asserts upon failure.
    """
    assert shutil.which(executable), "Need {!r} on the PATH.{}".format(
        executable, "\n" + explanation if explanation else "")