'Set values for all possible rule components on the RuleTarget.
If a value for a valid component for this target_type was not specified,
set to the default value for that component. Set attr values to None for
all components that only apply to other types.'

def set_values(self, values):

    self.checks = set()
    self.actions = set()
    for (key, component) in self._potential_components.iteritems():
        if (self.target_type in component.valid_targets):
            value = None
            sources = ([key] + component.aliases)
            for source in sources:
                from_source = values.pop(source, None)
                if (value is None):
                    value = from_source
            if (value is not None):
                if (not component.validate(value)):
                    raise AutoModeratorSyntaxError(('invalid    value    for    `%s`:    `%s`' % (key, value)), self.parent.yaml)
                setattr(self, key, value)
                if (component.component_type == 'check'):
                    self.checks.add(key)
                elif (component.component_type == 'action'):
                    self.actions.add(key)
            else:
                setattr(self, key, component.default)
        else:
            if (key in values):
                raise AutoModeratorRuleTypeError(("Can't    use    `%s`    on    this    type" % key), self.parent.yaml)
            setattr(self, key, None)
    if (self.set_flair is not None):
        if isinstance(self.set_flair, basestring):
            self.set_flair = [self.set_flair, '']
        while (len(self.set_flair) < 2):
            self.set_flair.append('')
        self.set_flair = {'text': self.set_flair[0], 'class': self.set_flair[1]}
    if (self.set_suggested_sort == 'best'):
        self.set_suggested_sort = 'confidence'
