Returns a monad whose elements are all those elements of this monad for which the given predicate returned true
544291
def select(lam = nil, &blk)
      bind { |x| (lam || blk).call(x) ? self.class.unit(x) : self.class.empty }
    end
512101
def partition(predicate, iterable):
    

    t1, t2 = tee(iterable)

    return filterfalse(predicate, t1), filter(predicate, t2)
1091074
public static <D> Predicate in(Expression<D> left, Collection<? extends D> right) {
        if (right.size() == 1) {
            return eqConst(left, right.iterator().next());
        } else {
            return predicate(Ops.IN, left, ConstantImpl.create(right));
        }
    }
707170
public boolean is(MatrixPredicate predicate) {
        MatrixIterator it = iterator();
        boolean result = predicate.test(rows, columns);

        while (it.hasNext() && result) {
            double x = it.next();
            int i = it.rowIndex();
            int j = it.columnIndex();
            result = predicate.test(i, j, x);
        }

        return result;
    }
309713
public static <T> Predicate<Iterable<T>> anyPredicate(final Predicate<T> pred) {
    return new Predicate<Iterable<T>>() {
      @Override
      public boolean apply(final Iterable<T> iter) {
        return com.google.common.collect.Iterables.any(iter, pred);
      }
    };
  }
102271
public static <T> Predicate<T> FALSE() {
	return Predicate.<T>NOT(Predicate.<T>TRUE());
    }
1242399
def map_predicate(self, f):
        
        # Functions passed to this are of type str -> bool.  Don't ever call
        # them on None, which is the only non-str value we ever store in
        # categories.
        if self.missing_value is None:
            def f_to_use(x):
                return False if x is None else f(x)
        else:
            f_to_use = f

        # Call f on each unique value in our categories.
        results = np.vectorize(f_to_use, otypes=[bool_dtype])(self.categories)

        # missing_value should produce False no matter what
        results[self.reverse_categories[self.missing_value]] = False

        # unpack the results form each unique value into their corresponding
        # locations in our indices.
        return results[self.as_int_array()]
67149
public static <T> Predicate<T> predicate(CheckedPredicate<T> predicate) {
        return predicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
730416
function matchDescendant(nodes, predicate) {
  return uniqueReduce(
    (matches, node) => matches.concat(treeFilter(node, predicate)),
    flat(nodes.map(childrenOfNode)),
  );
}
288759
public static <T extends Executable> Predicate<T> executableIsSynthetic() {
        return candidate -> candidate != null && candidate.isSynthetic();
    }
805969
public static <T> Predicate<T> falseInstance ()
    {
        @SuppressWarnings("unchecked") Predicate<T> pred = (Predicate<T>)FALSE_INSTANCE;
        return pred;
    }
913402
public boolean forall(PixelPredicate predicate) {
        return Arrays.stream(points()).allMatch(p -> predicate.test(p.x, p.y, pixel(p)));
    }
1360941
function indexOf(srcArr, predicate) {
      for (var i = 0; i < srcArr.length; i++) {
        if (isObj(predicate)) {
          if (keys(predicate).every(
            function (k) { return srcArr[i][k] === predicate[k]; })
          ) return i;
        } else if (isFun(predicate)) {
          if (predicate(srcArr[i])) return i;
        }
      }
      return srcArr.indexOf(predicate);
    }
230680
def find_all(self, predicate):
        
        for _nid, entry in self._registry.items():
            if predicate(entry):
                yield entry
984821
function isSemanticPredicate( element ) {

    const type = element.expression.type;

    if ( type === "semantic_and" ) return true;
    if ( type === "semantic_not" ) return true;

    return false;

}
783155
function predicate (fn, string) {
  var idx = -1
  var end = string.length
  var out = []
  var buf = ''

  while (++idx < end) {
    if (fn(string[idx], idx) === true) {
      if (buf) out.push(buf)
      buf = ''
    } else {
      buf += string[idx]
    }
  }

  if (buf) out.push(buf)
  return out
}
413076
def contains(self, element, key=lambda x: x):
        
        return self.select(key).any(lambda x: x == key(element))