Returns the composition of a function and a predicate. For every {@code x}, the generated
predicate returns {@code predicate(function(x))}.

@return the composition of the provided function and predicate
427982
public static <A, B> Predicate<A> compose(
      Predicate<B> predicate, Function<A, ? extends B> function) {
    return new CompositionPredicate<A, B>(predicate, function);
  }
959957
public static OpPredicate classEquals(final Class<?> c){
        return new OpPredicate() {
            @Override
            public boolean matches(SameDiff sameDiff, DifferentialFunction function) {
                return function.getClass() == c;
            }
        };
    }
1340232
private static TriFunction<AnyBiPredicate, MetricValue, MetricValue, Optional<Boolean>> select_(SelType x, SelType y) {
        switch (x) {
            case BOOLEAN:
                switch (y) {
                    case BOOLEAN:
                    {
                        TriFunction<AnyBiPredicate, Boolean, Boolean, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getBoolValue).bind3_fn(MetricValue::getBoolValue);
                    }
                    case INT:
                    {
                        TriFunction<AnyBiPredicate, Boolean, Long, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getBoolValue).bind3_fn(MetricValue::getIntValue);
                    }
                    case FLOAT:
                    {
                        TriFunction<AnyBiPredicate, Boolean, Double, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getBoolValue).bind3_fn(MetricValue::getFltValue);
                    }
                    case STRING:
                    {
                        TriFunction<AnyBiPredicate, Boolean, String, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getBoolValue).bind3_fn(MetricValue::getStrValue);
                    }
                    case HISTOGRAM:
                    {
                        TriFunction<AnyBiPredicate, Boolean, Histogram, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getBoolValue).bind3_fn(MetricValue::getHistValue);
                    }
                    case NONE:
                        return AnyBiPredicate::unbound_;
                }
                break;
            case INT:
                switch (y) {
                    case BOOLEAN:
                    {
                        TriFunction<AnyBiPredicate, Long, Boolean, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getIntValue).bind3_fn(MetricValue::getBoolValue);
                    }
                    case INT:
                    {
                        TriFunction<AnyBiPredicate, Long, Long, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getIntValue).bind3_fn(MetricValue::getIntValue);
                    }
                    case FLOAT:
                    {
                        TriFunction<AnyBiPredicate, Long, Double, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getIntValue).bind3_fn(MetricValue::getFltValue);
                    }
                    case STRING:
                    {
                        TriFunction<AnyBiPredicate, Long, String, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getIntValue).bind3_fn(MetricValue::getStrValue);
                    }
                    case HISTOGRAM:
                    {
                        TriFunction<AnyBiPredicate, Long, Histogram, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getIntValue).bind3_fn(MetricValue::getHistValue);
                    }
                    case NONE:
                        return AnyBiPredicate::unbound_;
                }
                break;
            case FLOAT:
                switch (y) {
                    case BOOLEAN:
                    {
                        TriFunction<AnyBiPredicate, Double, Boolean, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getFltValue).bind3_fn(MetricValue::getBoolValue);
                    }
                    case INT:
                    {
                        TriFunction<AnyBiPredicate, Double, Long, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getFltValue).bind3_fn(MetricValue::getIntValue);
                    }
                    case FLOAT:
                    {
                        TriFunction<AnyBiPredicate, Double, Double, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getFltValue).bind3_fn(MetricValue::getFltValue);
                    }
                    case STRING:
                    {
                        TriFunction<AnyBiPredicate, Double, String, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getFltValue).bind3_fn(MetricValue::getStrValue);
                    }
                    case HISTOGRAM:
                    {
                        TriFunction<AnyBiPredicate, Double, Histogram, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getFltValue).bind3_fn(MetricValue::getHistValue);
                    }
                    case NONE:
                        return AnyBiPredicate::unbound_;
                }
                break;
            case STRING:
                switch (y) {
                    case BOOLEAN:
                    {
                        TriFunction<AnyBiPredicate, String, Boolean, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getStrValue).bind3_fn(MetricValue::getBoolValue);
                    }
                    case INT:
                    {
                        TriFunction<AnyBiPredicate, String, Long, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getStrValue).bind3_fn(MetricValue::getIntValue);
                    }
                    case FLOAT:
                    {
                        TriFunction<AnyBiPredicate, String, Double, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getStrValue).bind3_fn(MetricValue::getFltValue);
                    }
                    case STRING:
                    {
                        TriFunction<AnyBiPredicate, String, String, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getStrValue).bind3_fn(MetricValue::getStrValue);
                    }
                    case HISTOGRAM:
                    {
                        TriFunction<AnyBiPredicate, String, Histogram, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getStrValue).bind3_fn(MetricValue::getHistValue);
                    }
                    case NONE:
                        return AnyBiPredicate::unbound_;
                }
                break;
            case HISTOGRAM:
                switch (y) {
                    case BOOLEAN:
                    {
                        TriFunction<AnyBiPredicate, Histogram, Boolean, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getHistValue).bind3_fn(MetricValue::getBoolValue);
                    }
                    case INT:
                    {
                        TriFunction<AnyBiPredicate, Histogram, Long, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getHistValue).bind3_fn(MetricValue::getIntValue);
                    }
                    case FLOAT:
                    {
                        TriFunction<AnyBiPredicate, Histogram, Double, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getHistValue).bind3_fn(MetricValue::getFltValue);
                    }
                    case STRING:
                    {
                        TriFunction<AnyBiPredicate, Histogram, String, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getHistValue).bind3_fn(MetricValue::getStrValue);
                    }
                    case HISTOGRAM:
                    {
                        TriFunction<AnyBiPredicate, Histogram, Histogram, Optional<Boolean>> fn = AnyBiPredicate::predicate;
                        return fn.bind2_fn(MetricValue::getHistValue).bind3_fn(MetricValue::getHistValue);
                    }
                    case NONE:
                        return AnyBiPredicate::unbound_;
                }
                break;
            case NONE:
                switch (y) {
                    case BOOLEAN:
                    case INT:
                    case FLOAT:
                    case STRING:
                    case NONE:
                        return AnyBiPredicate::unbound_;
                }
        }

        throw new IllegalStateException("Unrecognized Selection type");
    }
137912
public FaceletTaglibFunctionType<FaceletTaglibType<T>> getOrCreateFunction()
   {
      List<Node> nodeList = childNode.get("function");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FaceletTaglibFunctionTypeImpl<FaceletTaglibType<T>>(this, "function", childNode, nodeList.get(0));
      }
      return createFunction();
   }
738036
@Nonnull
	public <V1 extends T1, V2 extends T2> LBiObjSrtPredicateBuilder<T1, T2> aCase(Class<V1> argC1, Class<V2> argC2, LBiObjSrtPredicate<V1, V2> function) {
		PartialCaseWithBoolProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)));

		pc.evaluate(function);
		return self();
	}
4299
public static <K, V> Function<Map.Entry<K, V>, V> entryToValueFunction() {
      return EntryToValueFunction.getInstance();
   }
563222
public Predicate<T> and( 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);
            }
        };
    }
98236
function getPredicateFunction(predicate) {
    let fn = predicate;
    if (_.isString(predicate)) {
        fn = node => (_.isFunction(node[predicate]) ? node[predicate]() : node[predicate]);
    }

    return fn;
}
782071
public static <T, R> Function<T, R> doIf(final Predicate<T> condition, final CheckedFunction<T, R> trueFunction,
                                             final CheckedFunction<T, R> falseFunction) {
        return t -> {
            try {
                if (condition.test(t)) {
                    return trueFunction.apply(t);
                }
                return falseFunction.apply(t);
            } catch (final Throwable e) {
                LOGGER.warn(e.getMessage(), e);
                try {
                    return falseFunction.apply(t);
                } catch (final Throwable ex) {
                    throw new IllegalArgumentException(ex.getMessage());
                }
            }
        };
    }
1005592
public static Predicates<Object> in(Iterable<?> iterable)
    {
        if (iterable instanceof SetIterable<?>)
        {
            return new InSetIterablePredicate((SetIterable<?>) iterable);
        }
        if (iterable instanceof Set<?>)
        {
            return new InSetPredicate((Set<?>) iterable);
        }
        if (iterable instanceof Collection<?> && ((Collection<?>) iterable).size() <= SMALL_COLLECTION_THRESHOLD)
        {
            return new InCollectionPredicate((Collection<?>) iterable);
        }
        return new InSetIterablePredicate(UnifiedSet.newSet(iterable));
    }
1158481
public static <T> Function<T, Boolean> forPredicate (final Predicate<T> predicate)
    {
        return new Function<T, Boolean>() {
            public Boolean apply (T arg) {
                return predicate.apply(arg);
            }
        };
    }
240568
def compose(*functions):
    

    def _compose2(f, g):  # pylint: disable=invalid-name
        return lambda x: f(g(x))

    return functools.reduce(_compose2, functions, lambda x: x)
106924
public <R> AnimaQuery<T> and(TypeFunction<T, R> function) {
        return this.where(function);
    }
818381
public static <T> Predicate<T> and(final Predicate<? super T> first, final Predicate<? super T> second) {
        return new Predicate<T>() {
            @Override
            public boolean test(final T testValue) {
                return first.test(testValue) && second.test(testValue);
            }
        };
    }
340992
@Override
    public boolean allMatch($.Function<? super T, Boolean> predicate) {
        return !anyMatch($.F.negate(predicate));
    }
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);
	    }
	};
    }
985269
public static <T1, T2> BiPredicate<T1, T2> and(BiPredicate<T1, T2>... predicates) {
        dbc.precondition(predicates != null, "predicates is null");
        return Logic.Binary.and(Iterations.iterable(predicates));
    }