// filter returns those entries from an MirrorInfo array for which the given
// match function returns true. It preserves order.
10649
func (entries MirrorInfoSlice) filter(match func(*MirrorInfo) bool) MirrorInfoSlice {
	result := MirrorInfoSlice{}
	for _, mirrorInfo := range entries {
		if match(&mirrorInfo) {
			result = append(result, mirrorInfo)
		}
	}
	return result
}
555491
func (a *FiltersAggregation) Filter(filter Query) *FiltersAggregation {
	a.unnamedFilters = append(a.unnamedFilters, filter)
	return a
}
229409
func (f *StateFilter) Filter(fs ...string) ([]*StateFilterResult, error) {
	// Parse all the addresses
	as := make([]*ResourceAddress, len(fs))
	for i, v := range fs {
		a, err := ParseResourceAddress(v)
		if err != nil {
			return nil, fmt.Errorf("Error parsing address '%s': %s", v, err)
		}

		as[i] = a
	}

	// If we weren't given any filters, then we list all
	if len(fs) == 0 {
		as = append(as, &ResourceAddress{Index: -1})
	}

	// Filter each of the address. We keep track of this in a map to
	// strip duplicates.
	resultSet := make(map[string]*StateFilterResult)
	for _, a := range as {
		for _, r := range f.filterSingle(a) {
			resultSet[r.String()] = r
		}
	}

	// Make the result list
	results := make([]*StateFilterResult, 0, len(resultSet))
	for _, v := range resultSet {
		results = append(results, v)
	}

	// Sort them and return
	sort.Sort(StateFilterResultSlice(results))
	return results, nil
}
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
}
1307591
func (m *txSortedMap) Filter(filter func(*types.Transaction) bool) types.Transactions {
	var removed types.Transactions

	// Collect all the transactions to filter out
	for nonce, tx := range m.items {
		if filter(tx) {
			removed = append(removed, tx)
			delete(m.items, nonce)
		}
	}
	// If transactions were removed, the heap and cache are ruined
	if len(removed) > 0 {
		*m.index = make([]uint64, 0, len(m.items))
		for nonce := range m.items {
			*m.index = append(*m.index, nonce)
		}
		heap.Init(m.index)

		m.cache = nil
	}
	return removed
}
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
}
343583
func (nodes CheckServiceNodes) Filter(onlyPassing bool) CheckServiceNodes {
	return nodes.FilterIgnore(onlyPassing, nil)
}
335760
func (g *genFakeForGroup) Filter(c *generator.Context, t *types.Type) bool {
	if !g.called {
		g.called = true
		return true
	}
	return false
}
893491
func (i *Datetime) Filter(entry *Entry) (validEntry *Entry) {
	val, err := entry.Field(i.Field)
	if err != nil {
		// TODO handle error
		return
	}
	t, err := time.Parse(i.Format, val)
	if err != nil {
		// TODO handle error
		return
	}
	if i.withinBounds(t) {
		validEntry = entry
	}
	return
}
380920
func (members Members) Filter(filter func(member NetworkMember) bool) Members {
	var res Members
	for _, member := range members {
		if filter(member) {
			res = append(res, member)
		}
	}
	return res
}
968941
func Filter(vs []string, f func(string) bool) []string {
	r := make([]string, 0, len(vs))
	for _, v := range vs {
		if f(v) {
			r = append(r, v)
		}
	}
	return r
}
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
}
283862
func (b *RouteBuilder) Filter(filter FilterFunction) *RouteBuilder {
	b.filters = append(b.filters, filter)
	return b
}
29501
func (w *WebService) Filter(filter FilterFunction) *WebService {
	w.filters = append(w.filters, filter)
	return w
}
870332
func (es Errors) Filter() error {
	for key, value := range es {
		if value == nil {
			delete(es, key)
		}
	}
	if len(es) == 0 {
		return nil
	}
	return es
}
1110480
func (s *FieldSort) Filter(filter Query) *FieldSort {
	s.filter = filter
	return s
}
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
}