def _check_criterion(self, criterion_k, criterion_v, payload_lookup):
        if criterion_v not in 'type':
            # Comparison operator type not specified, can't perform a comparison
            return False

        criteria_operator = criterion_v['type']
        criteria_pattern = criterion_v.get('pattern', None)

        # Render the pattern (it can contain a jinja expressions)
        try:
            criteria_pattern = self._render_criteria_pattern(criteria_pattern=criteria_pattern)
        except Exception:
            LOG.exception('Failed to render pattern value "%s" for key "%s"' %
                          (criteria_pattern, criterion_k), extra=self._base_logger_context)
            return False

        try:
            matches = payload_lookup.get_value(criterion_k)
            # pick value if only 1 matches else will end up being an array match.
            if matches:
                payload_value = matches[0] if len(matches) > 0 else matches
            else:
                payload_value = None
        except:
            LOG.exception('Failed transforming criteria key %s', criterion_k,
                          extra=self._base_logger_context)
            return False

        op_func = criteria_operators.get_operator(criteria_operator)

        try:
            result = op_func(value=payload_value, criteria_pattern=criteria_pattern)
        except:
            LOG.exception('There might be a problem with critera in rule %s.', self.rule,
                          extra=self._base_logger_context)
            return False

        return result, payload_value, criteria_pattern
dataset/ETHPy150Open StackStorm/st2/st2reactor/st2reactor/rules/filter.py/RuleFilter._check_criterion/swapped operands of `not in`