def fuzzylogic(features, cfg, require="all"):
    """

        FIXME: Think about, should I return 0, or have an assert, and at qc.py
          all qc tests are applied with a try, and in case it fails it flag
          0s.

    """
    require = cfg.get("require", require)

    if (require == "all") and not np.all([f in features for f in cfg["features"]]):
        module_logger.warning(
            "Not all features (%s) required by fuzzy logic are available".format(
                cfg["features"].keys()
            )
        )
        raise KeyError

    uncertainty = fuzzy_uncertainty(
        data=features, features=cfg["features"], output=cfg["output"], require=require
    )

    return uncertainty