Combines multiple predicate functions to produce new AND predicate
@method or
513801
function and() {
    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.every(function (predicate) {
        return check.fn(predicate) ?
          predicate.apply(null, values) : Boolean(predicate);
      });
    };
  }
647179
function _filter (node, expr, resultSet) {
        var
            selectedNodes,
            conditions,
            type,
            idx,
            condition;
        if (expr.and) {
            conditions = expr.and;
            type = 0;
        } else if (expr.or) {
            conditions = expr.or;
            type = 1;
        }
        for (idx = 0; idx < conditions.length; ++idx) {
            condition = conditions[idx];
            if (condition.and || condition.or) {
                selectedNodes = [];
                _filter(node, condition, selectedNodes);
            } else {
                selectedNodes = _select(node, condition);
            }
            if (0 === type && selectedNodes.length === 0) {
                return;
            }
            if (1 === type && selectedNodes.length !== 0) {
                resultSet.push(node);
                return;
            }
        }
        if (0 === type) {
            resultSet.push(node);
        }
    }
551982
function disjunctions(predicates) {

			return function (input) {
				var _iteratorNormalCompletion2 = true;
				var _didIteratorError2 = false;
				var _iteratorError2 = undefined;

				try {

					for (var _iterator2 = predicates[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
						var predicate = _step2.value;

						if (predicate(input)) return true;
					}
				} catch (err) {
					_didIteratorError2 = true;
					_iteratorError2 = err;
				} finally {
					try {
						if (!_iteratorNormalCompletion2 && _iterator2["return"]) {
							_iterator2["return"]();
						}
					} finally {
						if (_didIteratorError2) {
							throw _iteratorError2;
						}
					}
				}

				return false;
			};
		}
1028774
static <T extends CompoundPredicate> T flattenCompound(Predicate predicateLeft, Predicate predicateRight, Class<T> klass) {
        // The following could have been achieved with {@link com.hazelcast.query.impl.predicates.FlatteningVisitor},
        // however since we only care for 2-argument flattening, we can avoid constructing a visitor and its internals
        // for each token pass at the cost of the following explicit code.
        Predicate[] predicates;
        if (klass.isInstance(predicateLeft) || klass.isInstance(predicateRight)) {
            Predicate[] left = getSubPredicatesIfClass(predicateLeft, klass);
            Predicate[] right = getSubPredicatesIfClass(predicateRight, klass);

            predicates = new Predicate[left.length + right.length];
            ArrayUtils.concat(left, right, predicates);
        } else {
            predicates = new Predicate[]{predicateLeft, predicateRight};
        }
        try {
            CompoundPredicate compoundPredicate = klass.newInstance();
            compoundPredicate.setPredicates(predicates);
            return (T) compoundPredicate;
        } catch (InstantiationException e) {
            throw new RuntimeException(String.format("%s should have a public default constructor", klass.getName()));
        } catch (IllegalAccessException e) {
            throw new RuntimeException(String.format("%s should have a public default constructor", klass.getName()));
        }
    }
1275508
public static <T> Function<T, Boolean> function(Predicate<T> adaptee) {
        dbc.precondition(adaptee != null, "cannot adapt a null predicate");
        return adaptee::test;
    }
838145
public static <T> Predicate<T> OR(final Predicate<T> a, final Predicate<T> b) {
	return new Predicate<T>() {
	    public boolean check(T obj) {
		return a.check(obj) || b.check(obj);
	    }
	};
    }
783148
function parse_where_type_condition_array(query, type) {
	var predicates = ARRAY(type).map(function(t) {
		if(is.string(t)) {
			return new Predicate("type = $", t);
		}
		if(type instanceof NoPg.Type) {
			return new Predicate("types_id = $", type.$id);
		}
		throw new TypeError("Unknown type: " + util.inspect(t));
	}).valueOf();
	query.where( Predicate.join(predicates, 'OR') );
}
462083
function filter(pred, m) {
  if(!isPredOrFunc(pred)) {
    throw new TypeError('filter: Pred or predicate function required for first argument')
  }

  const fn =
    x => predOrFunc(pred, x)

  if(m && isFunction(m.filter)) {
    return m.filter(fn)
  }

  if(m && isObject(m)) {
    return object.filter(fn, m)
  }

  throw new TypeError('filter: Filterable or Object required for second argument')
}
906740
def or_(cls, obj, **kwargs):
        
        return cls.__eval_seqexp(obj, operator.or_, **kwargs)
74113
public Predicate<T> or( final Predicate<T> other ) {
        if (other == null || other == this) return this;
        return new Predicate<T>() {
            @Override
            public boolean test( T input ) {
                return Predicate.this.test(input) || other.test(input);
            }
        };
    }
329286
function makePredicate(words) {
      if (!(words instanceof Array)) words = words.split(" ");
      var f = "", cats = [];
      out: for (var i = 0; i < words.length; ++i) {
          for (var j = 0; j < cats.length; ++j)
              if (cats[j][0].length == words[i].length) {
                  cats[j].push(words[i]);
                  continue out;
              }
          cats.push([words[i]]);
      }
      function quote(word) {
          return JSON.stringify(word).replace(/[\u2028\u2029]/g, function(s) {
              switch (s) {
                  case "\u2028": return "\\u2028";
                  case "\u2029": return "\\u2029";
              }
              return s;
          });
      }
      function compareTo(arr) {
          if (arr.length == 1) return f += "return str === " + quote(arr[0]) + ";";
          f += "switch(str){";
          for (var i = 0; i < arr.length; ++i) f += "case " + quote(arr[i]) + ":";
          f += "return true}return false;";
      }
      // When there are more than three length categories, an outer
      // switch first dispatches on the lengths, to save on comparisons.
      if (cats.length > 3) {
          cats.sort(function(a, b) {return b.length - a.length;});
          f += "switch(str.length){";
          for (var i = 0; i < cats.length; ++i) {
              var cat = cats[i];
              f += "case " + cat[0].length + ":";
              compareTo(cat);
          }
          f += "}";
          // Otherwise, simply generate a flat `switch` statement.
      } else {
          compareTo(words);
      }
      return new Function("str", f);
  }
427982
public static <A, B> Predicate<A> compose(
      Predicate<B> predicate, Function<A, ? extends B> function) {
    return new CompositionPredicate<A, B>(predicate, function);
  }
410757
public static Predicate or(Predicate left, Predicate right) {
        left = (Predicate) extract(left);
        right = (Predicate) extract(right);
        if (left == null) {
            return right;
        } else if (right == null) {
            return left;
        } else {
            return predicate(Ops.OR, left, right);
        }
    }
997767
def _DoPredicates(args, context, callback, trace):
    
    block = args
    value = context.Lookup('@')
    for (predicate, args, func_type), statements in block.clauses:
        if func_type == ENHANCED_FUNC:
            do_clause = predicate(value, context, args)
        else:
            do_clause = predicate(value)
        
        if do_clause:
            if trace: trace.Push(predicate)
            _Execute(statements, context, callback, trace)
            if trace: trace.Pop()
            break
919528
public static CharPredicate or(final CharPredicate... predicates) {
    if (predicates.length == 0)
      return NEVER;
    else if (predicates.length == 1) return predicates[0];
    return new CharPredicate() {
      @Override public boolean isChar(char c) {
        for(int i = 0;i < predicates.length;i++) {
          if (predicates[i].isChar(c)) return true;
        }
        return false;
      }
      @Override public String toString() {
        return Strings.join(" or ", predicates);
      }
    };
  }
80098
function mix (r, s, or, cl) {
  if (!s || !r) {
    return r;
  }

  var i = 0,
    c, len;

  or = or || arguments.length === 2;

  if (cl && (len = cl.length)) {
    for (; i < len; i++) {
      c = cl[i];
      if ((c in s) && (or || !(c in r))) {
        r[c] = s[c];
      }
    }
  } else {
    for (c in s) {
      if (or || !(c in r)) {
        r[c] = s[c];
      }
    }
  }
  return r;
}
618930
function methodMatch(part) {
    let maxMatch = null
    let maxMatchCount = 0

    // Go through each mapper and check if the name matches. Then, take the highest match to avoid matching
    // 'any', if 'any character' was given, and so on.
    Object.keys(mapper).forEach((key) => {
        const regex = new RegExp(`^(${key.replace(' ', ') (')})`, 'i')
        const matches = part.match(regex)

        const count = matches ? matches.length : 0

        if (count > maxMatchCount) {
            maxMatchCount = count
            maxMatch = key
        }
    })

    if (maxMatch) {
        // We've got a match. Create the desired object and populate it.
        const item = mapper[maxMatch]
        return new item['class'](maxMatch, item.method, buildQuery)
    }

    throw new SyntaxException(`Invalid method: ${part}`)
}