// Filter applies the provided predicates to the payloads and returns
// only those that matched.
778910
func Filter(payloads []FullPayloadInfo, predicates ...PayloadPredicate) []FullPayloadInfo {
	var results []FullPayloadInfo
	for _, payload := range payloads {
		if matched := filterOne(payload, predicates); matched {
			results = append(results, payload)
		}
	}
	return results
}
268866
func Filter(chains [][]*x509.Certificate, f RankingFunc) [][]*x509.Certificate {
	// If there are no chain or only 1 chain, we are done.
	if len(chains) <= 1 {
		return chains
	}

	bestChain := chains[0]
	var candidateChains [][]*x509.Certificate
	for _, chain := range chains {
		r := f(bestChain, chain)
		if r < 0 {
			bestChain = chain
			candidateChains = [][]*x509.Certificate{chain}
		} else if r == 0 {
			candidateChains = append(candidateChains, chain)
		}
	}
	return candidateChains
}
648886
func (c *Client) GetPrefilter() (*models.Prefilter, error) {
	resp, err := c.Prefilter.GetPrefilter(nil)
	if err != nil {
		return nil, Hint(err)
	}
	return resp.Payload, nil
}
436157
func (s strings) Filter(in []string, keep func(item string) bool) []string {
	var out []string
	for _, item := range in {
		if keep(item) {
			out = append(out, item)
		}
	}

	return out
}
118360
func (l *locksFlags) Filters() (map[string]string, error) {
	filters := make(map[string]string)

	if l.Path != "" {
		path, err := lockPath(l.Path)
		if err != nil {
			return nil, err
		}

		filters["path"] = path
	}
	if l.Id != "" {
		filters["id"] = l.Id
	}

	return filters, nil
}
16218
func Filter(p, xs interface{}) interface{} {
	chk := ty.Check(
		new(func(func(ty.A) bool, []ty.A) []ty.A),
		p, xs)
	vp, vxs, tys := chk.Args[0], chk.Args[1], chk.Returns[0]

	xsLen := vxs.Len()
	vys := reflect.MakeSlice(tys, 0, xsLen)
	for i := 0; i < xsLen; i++ {
		vx := vxs.Index(i)
		if call1(vp, vx).Bool() {
			vys = reflect.Append(vys, vx)
		}
	}
	return vys.Interface()
}
343583
func (nodes CheckServiceNodes) Filter(onlyPassing bool) CheckServiceNodes {
	return nodes.FilterIgnore(onlyPassing, nil)
}
948229
func Filter(result []Expression, input []Expression, filter func(Expression) bool) []Expression {
	for _, e := range input {
		if filter(e) {
			result = append(result, e)
		}
	}
	return result
}
893699
func (f *DedupSQSFilter) Filter(msg *sqs.Message) bool {
	msgBody := aws.StringValue(msg.Body)
	if !f.cache.Set(msgBody, "") {
		logger.WithField("message", msgBody).Info("Removing a duplicate")
		return false
	}
	return true
}
705934
func (list ErrorList) Filter(fns ...utilerrors.Matcher) ErrorList {
	err := utilerrors.FilterOut(list.ToAggregate(), fns...)
	if err == nil {
		return nil
	}
	// FilterOut takes an Aggregate and returns an Aggregate
	return fromAggregate(err.(utilerrors.Aggregate))
}
1242483
func (d *Decoder) filters(tok *token) {
	for {
		d.filter()
		tok = d.next()
		if tok.t == tokenLBracket {
			continue
		} else {
			d.backup()
			break
		}
	}
}
397884
func (c xlsxCalcChainCollection) Filter(fn func(v xlsxCalcChainC) bool) []xlsxCalcChainC {
	results := make([]xlsxCalcChainC, 0)
	for _, v := range c {
		if fn(v) {
			results = append(results, v)
		}
	}
	return results
}
581073
func Filter(m map[amqp.Symbol]interface{}) LinkOption {
	return func(l *linkSettings) { l.filter = m }
}
1190063
func (q *FunctionScoreQuery) Filter(filter Query) *FunctionScoreQuery {
	q.filter = filter
	return q
}
372647
func Filter(arr interface{}, predicate interface{}) interface{} {
	if !IsIteratee(arr) {
		panic("First parameter must be an iteratee")
	}

	if !IsFunction(predicate, 1, 1) {
		panic("Second argument must be function")
	}

	funcValue := reflect.ValueOf(predicate)

	funcType := funcValue.Type()

	if funcType.Out(0).Kind() != reflect.Bool {
		panic("Return argument should be a boolean")
	}

	arrValue := reflect.ValueOf(arr)

	arrType := arrValue.Type()

	// Get slice type corresponding to array type
	resultSliceType := reflect.SliceOf(arrType.Elem())

	// MakeSlice takes a slice kind type, and makes a slice.
	resultSlice := reflect.MakeSlice(resultSliceType, 0, 0)

	for i := 0; i < arrValue.Len(); i++ {
		elem := arrValue.Index(i)

		result := funcValue.Call([]reflect.Value{elem})[0].Interface().(bool)

		if result {
			resultSlice = reflect.Append(resultSlice, elem)
		}
	}

	return resultSlice.Interface()
}
1294319
func (r *Router) Filter(filter http.HandlerFunc) {
	r.Lock()
	r.filters = append(r.filters, filter)
	r.Unlock()
}
634349
func (f *FailFilter) Filter(nodes []Node) []Node {
	if len(nodes) <= 1 || f.MaxFails <= 0 {
		return nodes
	}
	nl := []Node{}
	for i := range nodes {
		marker := &failMarker{}
		if nil != nodes[i].marker {
			marker = nodes[i].marker.Clone()
		}
		// log.Logf("%s: %d/%d %v/%v", nodes[i], marker.failCount, f.MaxFails, marker.failTime, f.FailTimeout)
		if marker.failCount < uint32(f.MaxFails) ||
			time.Since(time.Unix(marker.failTime, 0)) >= f.FailTimeout {
			nl = append(nl, nodes[i])
		}
	}
	return nl
}