// PushFilter satisfies the builder interface.
// The primitive will be updated if the new filter improves the plan.
965651
func (rb *route) PushFilter(pb *primitiveBuilder, filter sqlparser.Expr, whereType string, _ builder) error {
	sel := rb.Select.(*sqlparser.Select)
	switch whereType {
	case sqlparser.WhereStr:
		sel.AddWhere(filter)
	case sqlparser.HavingStr:
		sel.AddHaving(filter)
	}
	rb.UpdatePlans(pb, filter)
	return nil
}
428785
func (q *Queue) PushFront(v interface{}) {
	q.lazyInit()
	q.lazyGrow()
	q.front = q.dec(q.front)
	q.rep[q.front] = v
	q.length++
}
1258389
func (p *Pipe) Push(procs ...Filter) *Pipe {
	for _, proc := range procs {
		if proc == nil {
			continue
		}

		err := make(chan error, 1)
		p.errors = append(p.errors, err)

		r, w := io.Pipe()

		go func(p Filter, r io.Reader, w *io.PipeWriter, err chan error) {
			err <- p(r, w)
			w.Close()
		}(proc, p.reader, w, err)

		p.reader = r
	}
	return p
}
565082
func filterAndPush(srcSel *Selection, nodes []*html.Node, m Matcher) *Selection {
	// Create a temporary Selection with the specified nodes to filter using winnow
	sel := &Selection{nodes, srcSel.document, nil}
	// Filter based on matcher and push on stack
	return pushStack(srcSel, winnow(sel, m, true))
}
1259979
func (fm *filterManager) SetFilter(filter ...Filter) {
	fm.fmLocker.Lock()
	fm.filters = make([]Filter, len(filter))
	fm.addFilter(filter...)
	fm.fmLocker.Unlock()
}
1313879
func (s *TopicConfiguration) SetFilter(v *NotificationConfigurationFilter) *TopicConfiguration {
	s.Filter = v
	return s
}
881549
func (s *MetricsConfiguration) SetFilter(v *MetricsFilter) *MetricsConfiguration {
	s.Filter = v
	return s
}
865441
func (filter *Stream) ApplyFilter(msg *core.Message) (core.FilterResult, error) {
	for _, blockedID := range filter.blacklist {
		if msg.GetStreamID() == blockedID {
			return filter.GetFilterResultMessageReject(), nil // ### return, explicitly blocked ###
		}
	}

	for _, allowedID := range filter.whitelist {
		if msg.GetStreamID() == allowedID {
			return core.FilterResultMessageAccept, nil // ### return, explicitly allowed ###
		}
	}

	// Return true if no whitlist is given, false otherwise (must fulfill whitelist)
	if len(filter.whitelist) > 0 {
		return filter.GetFilterResultMessageReject(), nil
	}

	return core.FilterResultMessageAccept, nil
}
481715
func (l *limit) PushFilter(_ *primitiveBuilder, _ sqlparser.Expr, whereType string, _ builder) error {
	panic("BUG: unreachable")
}
1109154
func (hook *AppInsightsHook) AddFilter(name string, fn func(interface{}) interface{}) {
	hook.filters[name] = fn
}
742362
func (filter *JSON) ApplyFilter(msg *core.Message) (core.FilterResult, error) {
	values := tcontainer.NewMarshalMap()
	if err := json.Unmarshal(filter.getAppliedContent(msg), &values); err != nil {
		return filter.GetFilterResultMessageReject(), err
	}

	// Check rejects
	for key, exp := range filter.rejectValues {
		if value, exists := filter.getValue(key, values); exists {
			if exp.MatchString(value) {
				return filter.GetFilterResultMessageReject(), nil
			}
		}
	}

	// Check accepts
	for key, exp := range filter.acceptValues {
		if value, exists := filter.getValue(key, values); exists {
			if !exp.MatchString(value) {
				return filter.GetFilterResultMessageReject(), nil
			}
		}
	}

	return core.FilterResultMessageAccept, nil
}
790334
func (slist *syncedList) PushFront(v interface{}) *list.Element {
	slist.Lock()
	defer slist.Unlock()

	return slist.queue.PushFront(v)
}
393641
func (client *BaseClient) AddFilter(filter ...Filter) Client {
	client.filterManager.AddFilter(filter...)
	return client
}
686508
func Filters(f ...Filter) Modifier {
	return func(r *http.Request) error {
		for _, filter := range f {
			filter(r)
		}
		return nil // Or should filter return err?
	}
}
897149
func (s *SearchSource) PostFilter(postFilter Filter) *SearchSource {
	s.postFilter = postFilter
	return s
}
1227032
func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule {
	s.Filter = v
	return s
}
860240
func (h *SMTPAPIHeader) AddFilter(filter, setting string, value interface{}) {
	if h.Filters == nil {
		h.Filters = make(map[string]Filter)
	}
	if _, ok := h.Filters[filter]; !ok {
		h.Filters[filter] = Filter{
			Settings: make(map[string]interface{}),
		}
	}
	h.Filters[filter].Settings[setting] = value
}