def _check_bool(var=None, varname=None, vardef=None):
    """ Check conformity of bool argument """
    if var is None:
        var = vardef
    c0 = isinstance(var, bool)
    if not c0:
        msg = (
            "Arg {} must bea bool!\n".format(varname)
            + "You provided:\n\t{}".format(var)
        )
        raise Exception(msg)
    return var