def clean(self, require_validation=True):
        key_attr = self.key.replace('-', '_')
        # aa stands for auxilarary attribute.
        if (not hasattr(self, key_attr) and
                not hasattr(self, "_aa_" + key_attr)):
            # ??? Do we want this?
            if self.force_validation and require_validation:
                raise ValidationError("No validator for key %s" % self.key)
            else:
                return
        if hasattr(self, key_attr):
            validate = getattr(self, key_attr)
        else:
            validate = getattr(self, "_aa_" + key_attr)

        if not callable(validate):
            raise ValidationError("No validator for key %s not callable" %
                                  key_attr)
        try:
            validate()
        except __HOLE__, e:
            # We want to catch when the validator didn't accept the correct
            # number of arguements.
            raise ValidationError("%s" % str(e))
        self.validate_unique()
dataset/ETHPy150Open rtucker-mozilla/mozilla_inventory/core/keyvalue/models.py/KeyValue.clean