exclusive Or rule_a || rule_b tries all alternatives and raises an error if there are two matching alternatives TODO check if matched state can be retreived from `ans`
325207
function() {

      if(this.disableXORs)
        return this._or.apply(this, arguments);
  
      var state = this.bt.current_state(),
          matched = 0,
          mismatches = [];
          ans;

      for(var i=1,len=arguments.length; i<len; i++) {
        try {
          ans = arguments[i].call(this);
          if(matched >= 1) break;
    
          matched++;
        } catch (f) {
          this.bt.catch_mismatch(f);
          this.bt.restore(state);
          mismatches.push(f);
        }
      }
      if(matched == 1) 
        return ans;

      if(matched > 1)
        this.bt.mismatch("More than one option matched by XOR")

      this.bt.mismatch("All alternatives failed");
    }
1336585
function(rule) {
      var ans = arguments[1] !== undefined ? [arguments[1]] : [],
          state;
      while (true) {
        state = this.bt.current_state();
        try { ans.push(rule.call(this)) } 
        catch (f) {
          this.bt.catch_mismatch(f);
          this.bt.restore(state);
          break;
        }
      }
      return ans
    }
461178
def matches(self, other):
        
        if not isinstance(other, Failure):
            return False
        if self.exc_info is None or other.exc_info is None:
            return self._matches(other)
        else:
            return self == other
989168
def UGE(a: BitVec, b: BitVec) -> Bool:
    
    return Or(UGT(a, b), a == b)
908977
def match?(rules)
      flat_hash(rules).keys.all? do |multi_keys|
        if multi_keys.last == :any
          actual_values = actual_value(self, multi_keys[0...-1])
          expected = expected_value(rules, multi_keys)
          actual_values.any? { |actual| match_value?(actual, expected) }
        elsif multi_keys.last == :not
          actual = actual_value(self, multi_keys[0...-1])
          expected = expected_value(rules, multi_keys)
          !match_value?(actual, expected)
        else
          actual = actual_value(self, multi_keys)
          expected = expected_value(rules, multi_keys)
          match_value?(actual, expected)
        end
      end
    end
828592
def expect_all(a, b):
    
    assert all(_a == _b for _a, _b in zip_longest(a, b))
851912
def assert_either_value_or_block(value, block)
      if value.nil? && block.nil?
        raise ArgumentError, 'Need to set either value or block'
      elsif !(value.nil? || block.nil?)
        raise ArgumentError, "Can't set both value and block"
      end
    end
36209
def execute_rule(rule, matches, context):
    
    if rule.enabled(context):
        log(rule.log_level, "Checking rule condition: %s", rule)
        when_response = rule.when(matches, context)
        if when_response:
            log(rule.log_level, "Rule was triggered: %s", when_response)
            log(rule.log_level, "Running rule consequence: %s %s", rule, when_response)
            rule.then(matches, when_response, context)
            return when_response
    else:
        log(rule.log_level, "Rule is disabled: %s", rule)
120379
function or() {
    var predicates = Array.prototype.slice.call(arguments, 0);
    if (!predicates.length) {
      throw new Error('empty list of arguments to or');
    }

    return function orCheck() {
      var values = Array.prototype.slice.call(arguments, 0);
      return predicates.some(function (predicate) {
        try {
          return check.fn(predicate) ?
            predicate.apply(null, values) : Boolean(predicate);
        } catch (err) {
          // treat exceptions as false
          return false;
        }
      });
    };
  }
275693
def matches(self, a, b, **config):
        
        package_a = self.processor._u2p(a['msg']['update']['title'])[0]
        package_b = self.processor._u2p(b['msg']['update']['title'])[0]
        if package_a != package_b:
            return False
        return True
402147
function(rule) {
      var state = this.bt.current_state();
      try { return rule.call(this); } 
      catch(f) {
        this.bt.catch_mismatch(f);
        this.bt.restore(state);
      }
    }
1250456
def _has_exclusive_option(cls, options):
        """"""
        return any([getattr(options, opt) is not None for opt in
                    cls.BASE_ERROR_SELECTION_OPTIONS])
458467
def ensure_one_opt(opt, parser, opt_list):
    

    the_one = None
    for name in opt_list:
        attr = name[2:].replace('-', '_')
        if hasattr(opt, attr) and (getattr(opt, attr) is not None):
            if the_one is None:
                the_one = name
            else:
                parser.error("%s and %s are mutually exculsive" \
                              % (the_one, name))

    if the_one is None:
        parser.error("you must supply one of the following %s" \
                      % (', '.join(opt_list)))
1118619
public static <T1, T2> BiPredicate<T1, T2> or(BiPredicate<T1, T2> first, BiPredicate<T1, T2> second, BiPredicate<T1, T2> third) {
        dbc.precondition(first != null, "first predicate is null");
        dbc.precondition(second != null, "second predicate is null");
        dbc.precondition(third != null, "third predicate is null");
        return Logic.Binary.or(Iterations.iterable(first, second, third));
    }
485414
function inconsistentArity(ruleName, expected, actual, expr) {
  return createError(
      'Rule ' + ruleName + ' involves an alternation which has inconsistent arity ' +
          '(expected ' + expected + ', got ' + actual + ')',
      expr.source);
}
212091
def one_of(inners, arg):
    """"""
    for inner in inners:
        with suppress(com.IbisTypeError, ValueError):
            return inner(arg)

    rules_formatted = ', '.join(map(repr, inners))
    raise com.IbisTypeError(
        'Arg passes neither of the following rules: {}'.format(rules_formatted)
    )
539470
def equal(self, a, b, message=None):
        ""
        if a != b:
            self.log_error("{} != {}".format(str(a), str(b)), message)
            return False
        return True