// NewBinningFilter creates a BinningFilter structure
// with some helpful default initialisations.
345750
func NewBinningFilter(d base.FixedDataGrid, bins int) *BinningFilter {
	return &BinningFilter{
		AbstractDiscretizeFilter{
			make(map[base.Attribute]bool),
			false,
			d,
		},
		bins,
		make(map[base.Attribute]float64),
		make(map[base.Attribute]float64),
	}
}
442988
func NewBindingInspector(mutualTLS bool, extractTLSCertHash CertHashExtractor) BindingInspector {
	if extractTLSCertHash == nil {
		panic(errors.New("extractTLSCertHash parameter is nil"))
	}
	inspectMessage := mutualTLSBinding
	if !mutualTLS {
		inspectMessage = noopBinding
	}
	return func(ctx context.Context, msg proto.Message) error {
		if msg == nil {
			return errors.New("message is nil")
		}
		return inspectMessage(ctx, extractTLSCertHash(msg))
	}
}
808957
func FilterConfiguringFilter(c *Controller, fc []Filter) {
	if newChain := getOverrideChain(c.Name, c.Action); newChain != nil {
		newChain[0](c, newChain[1:])
		return
	}
	fc[0](c, fc[1:])
}
705019
func NewPatchPrefilter(ctx *middleware.Context, handler PatchPrefilterHandler) *PatchPrefilter {
	return &PatchPrefilter{Context: ctx, Handler: handler}
}
396676
func NewBlockFilter(backend Backend, block common.Hash, addresses []common.Address, topics [][]common.Hash) *Filter {
	// Create a generic filter and convert it into a block filter
	filter := newFilter(backend, addresses, topics)
	filter.block = block
	return filter
}
867942
func NewGitFilter(cfg *config.Configuration) *GitFilter {
	return &GitFilter{cfg: cfg, fs: cfg.Filesystem()}
}
849583
func (_ENS *ENSFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte, label [][32]byte) (*ENSNewOwnerIterator, error) {

	var nodeRule []interface{}
	for _, nodeItem := range node {
		nodeRule = append(nodeRule, nodeItem)
	}
	var labelRule []interface{}
	for _, labelItem := range label {
		labelRule = append(labelRule, labelItem)
	}

	logs, sub, err := _ENS.contract.FilterLogs(opts, "NewOwner", nodeRule, labelRule)
	if err != nil {
		return nil, err
	}
	return &ENSNewOwnerIterator{contract: _ENS.contract, event: "NewOwner", logs: logs, sub: sub}, nil
}
417231
func (s *GeoDistanceSort) NestedFilter(nestedFilter Query) *GeoDistanceSort {
	s.nestedFilter = nestedFilter
	return s
}
242102
func (set *TemplateSet) BanFilter(name string) error {
	_, has := filters[name]
	if !has {
		return errors.Errorf("filter '%s' not found", name)
	}
	if set.firstTemplateCreated {
		return errors.New("you cannot ban any filters after you've added your first template to your template set")
	}
	_, has = set.bannedFilters[name]
	if has {
		return errors.Errorf("filter '%s' is already banned", name)
	}
	set.bannedFilters[name] = true

	return nil
}
779015
func (hook *FluentHook) AddFilter(name string, fn func(interface{}) interface{}) {
	hook.filters[name] = fn
}
432305
func NewFilter(includeRegex, excludeRegex string) (*Filter, error) {
	f := &Filter{}
	var err error
	if includeRegex != "" {
		f.inc, err = regexp.Compile(includeRegex)

		if err != nil {
			return nil, err
		}
	}
	if excludeRegex != "" {
		f.exc, err = regexp.Compile(excludeRegex)
		if err != nil {
			return nil, err
		}
	}

	return f, nil
}
768762
func NewRangeFilter(binName string, begin int64, end int64) *Filter {
	vBegin, vEnd := NewValue(begin), NewValue(end)
	return newFilter(binName, ICT_DEFAULT, vBegin.GetType(), vBegin, vEnd)
}
1101264
func newBytesBinParser(b []byte) *binParser {
	p := &binParser{bufio.NewReader(bytes.NewReader(b)), 0, 0}
	if p.r == nil {
		return nil
	}
	return p
}
307039
func newFilterNode(n, m node) node {
	return &filterNode{nodeType: nodeFilter, Input: n, Condition: m}
}
1331221
func (api *PublicFilterAPI) NewBlockFilter() rpc.ID {
	var (
		headers   = make(chan *types.Header)
		headerSub = api.events.SubscribeNewHeads(headers)
	)

	api.filtersMu.Lock()
	api.filters[headerSub.ID] = &filter{typ: BlocksSubscription, deadline: time.NewTimer(deadline), hashes: make([]common.Hash, 0), s: headerSub}
	api.filtersMu.Unlock()

	go func() {
		for {
			select {
			case h := <-headers:
				api.filtersMu.Lock()
				if f, found := api.filters[headerSub.ID]; found {
					f.hashes = append(f.hashes, h.Hash())
				}
				api.filtersMu.Unlock()
			case <-headerSub.Err():
				api.filtersMu.Lock()
				delete(api.filters, headerSub.ID)
				api.filtersMu.Unlock()
				return
			}
		}
	}()

	return headerSub.ID
}
798898
func NewObf(ruleConfigs []*TagMatchRuleConfig, next obfsink) (*SpanTagObfuscation, error) {
	rules, err := getRules(ruleConfigs)
	if err != nil {
		return nil, err
	}
	return &SpanTagObfuscation{
		rules: rules,
		next:  next,
	}, nil
}
524010
func NewDependentColumnFilter(compareFilter *CompareFilter, columnFamily, columnQualifier []byte,
	dropDependentColumn bool) *DependentColumnFilter {
	return &DependentColumnFilter{
		CompareFilter:       (*pb.CompareFilter)(compareFilter),
		ColumnFamily:        columnFamily,
		ColumnQualifier:     columnQualifier,
		DropDependentColumn: proto.Bool(dropDependentColumn),
	}
}