def valid_for(self, device):
        """
        """
        if not self.tags and not config.force:
            return False

        for tag_name, values in self.tags.iteritems():
            if tag_name.startswith('exclude_'):

                tag_getter = self._TAG_GETTERS[tag_name[len('exclude_'):]]
                if tag_getter(device) in values:
                    return False
            elif tag_name.endswith('_regex'):

                tag_getter = self._TAG_GETTERS[tag_name[:-len('_regex')]]
                if not re.match(values[0], tag_getter(device)):
                    return False
            elif tag_name == 'md5':
                pass
            else:
                tag_getter = self._TAG_GETTERS[tag_name]

                if tag_getter(device) not in values:
                    return False

        return True
dataset/ETHPy150Open facebook/fbpush/fbpush/main.py/Configlet.valid_for/original