def __invariant__(self):
        def _field_missing(fields):
            num_known_attributes = sum(getattr(self, name) is None
                                       for name in fields)
            return num_known_attributes not in (0, len(fields))
        if _field_missing(self._DATASET_ATTRIBUTES):
            return (False,
                    "Either all or none of {} must be set.".format(
                        self._DATASET_ATTRIBUTES))
        return (True, "")
dataset/ETHPy150Open ClusterHQ/flocker/flocker/control/_model.py/NodeState.__invariant__/original