Filters the sequence according to the given predicate.

This method MUST retain the state of the current instance, and return
an instance that contains the interval which validate the predicate.
972594
public function filter(callable $predicate): self
    {
        $intervals = array_filter($this->intervals, $predicate, ARRAY_FILTER_USE_BOTH);
        if ($intervals === $this->intervals) {
            return $this;
        }

        return new self(...$intervals);
    }
512720
public AutoscalePolicyFilter where(Predicate<AutoscalePolicyMetadata> predicate) {
        checkNotNull(predicate, "Predicate must be not a null");

        this.predicate = this.predicate.and(predicate);

        return this;
    }
997192
def is_sequence(obj):
    """"""
    return isinstance(obj, Sequence) and not (
        isinstance(obj, str) or BinaryClass.is_valid_type(obj))
1255073
public AntiAffinityPolicyFilter where(Predicate<AntiAffinityPolicyMetadata> filter) {
        checkNotNull(filter, "Filter predicate must be not a null");

        this.predicate = this.predicate.and(filter);

        return this;
    }
642467
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> filterLongs(LongPredicate b){

        return a->a.longs(i->i,s->s.filter(b));
    }
105792
@Override
    public ListT<W,T> filter(final Predicate<? super T> test) {
        return of(run.map(seq -> seq.filter(test)));
    }
1200300
def filter_records(self, records):
        
        for record in records:
            try:
                filtered = self.filter_record(record)
                assert (filtered)
                # Quick tracking whether the sequence was modified
                if filtered.seq == record.seq:
                    self.passed_unchanged += 1
                else:
                    self.passed_changed += 1
                yield filtered
            except FailedFilter as e:
                self.failed += 1
                v = e.value
                if self.listener:
                    self.listener(
                        'failed_filter',
                        record,
                        filter_name=self.name,
                        value=v)
1104687
private void filter(Predicate<TreeItem<S>> predicate) {
        if (task != null) {
            task.cancel(false);
        }
        task = threadPool.schedule(filterRunnable, 200, TimeUnit.MILLISECONDS);
    }
1097479
@NotNull
    public OptionalInt filter(@NotNull IntPredicate predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : OptionalInt.empty();
    }
710109
@NotNull
    public LongStream filterNot(@NotNull final LongPredicate predicate) {
        return filter(LongPredicate.Util.negate(predicate));
    }
1202407
def filter(table, predicates):
    
    resolved_predicates = _resolve_predicates(table, predicates)
    return _L.apply_filter(table, resolved_predicates)
1154833
def join_filter(sep, seq, pred=bool):
    
    return sep.join([text_type(i) for i in seq if pred(i)])
1771
public Optional<T> filter(final Predicate<? super T> predicate) {
        if (isPresent() && predicate.test(get())) {
            return this;
        }

        return empty();
    }
1301661
@NotNull
    public OptionalLong filterNot(@NotNull LongPredicate predicate) {
        return filter(LongPredicate.Util.negate(predicate));
    }
1220010
@NotNull
    public OptionalLong filter(@NotNull LongPredicate predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : OptionalLong.empty();
    }
1116805
public static <T> Collector<T, ?, Optional<T>> onlyOne(final Predicate<? super T> predicate) {
        final Collector<T, ?, Optional<T>> downstream = onlyOne();

        return filtering(predicate, downstream);
    }
858906
@CheckReturnValue
    public FluentGenerator<T> filter(@Nonnull Predicate<T> predicate) {
        return from(new FilteringGenerator<>(delegate, checkNotNull(predicate)));
    }