// NewFilter returns an endorser filter that uses the given exclusion filter and priority selector
// to filter and sort the endorsers
185435
func NewFilter(ps PrioritySelector, ef ExclusionFilter) Filter {
	return &filter{
		ef: ef,
		ps: ps,
	}
}
538840
func NewENSFilterer(address common.Address, filterer bind.ContractFilterer) (*ENSFilterer, error) {
	contract, err := bindENS(address, nil, nil, filterer)
	if err != nil {
		return nil, err
	}
	return &ENSFilterer{contract: contract}, nil
}
343980
func NewBloomFilter(n uint, fpRate float64) *BloomFilter {
	m := OptimalM(n, fpRate)
	return &BloomFilter{
		buckets: NewBuckets(m, 1),
		hash:    fnv.New64(),
		m:       m,
		k:       OptimalK(fpRate),
	}
}
726943
func NewFilteredExampleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
	return cache.NewSharedIndexInformer(
		&cache.ListWatch{
			ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.CrV1().Examples(namespace).List(options)
			},
			WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
				if tweakListOptions != nil {
					tweakListOptions(&options)
				}
				return client.CrV1().Examples(namespace).Watch(options)
			},
		},
		&crv1.Example{},
		resyncPeriod,
		indexers,
	)
}
1269461
func NewFilterBeforePredicate(d time.Duration) FilterPredicate {
	now := metav1.Now()
	before := metav1.NewTime(now.Time.Add(-1 * d))
	return func(build *buildv1.Build) bool {
		return build.CreationTimestamp.Before(&before)
	}
}
964426
func NewBoolFilter() BoolFilter {
	f := BoolFilter{
		mustClauses:    make([]Filter, 0),
		shouldClauses:  make([]Filter, 0),
		mustNotClauses: make([]Filter, 0),
	}
	return f
}
313586
func NewFilterExpr(name string, args []Expr, pos Pos) *FilterExpr {
	return &FilterExpr{NewFuncExpr(name, args, pos)}
}
156192
func NewChiMergeFilter(d base.FixedDataGrid, significance float64) *ChiMergeFilter {
	_, rows := d.Size()
	return &ChiMergeFilter{
		AbstractDiscretizeFilter{
			make(map[base.Attribute]bool),
			false,
			d,
		},
		make(map[base.Attribute][]*FrequencyTableEntry),
		significance,
		2,
		rows,
	}
}
1066813
func NewContainsRangeFilter(binName string, indexCollectionType IndexCollectionType, begin, end int64) *Filter {
	vBegin, vEnd := NewValue(begin), NewValue(end)
	return newFilter(binName, indexCollectionType, vBegin.GetType(), vBegin, vEnd)
}
758190
func (client *BaseClient) RemoveFilter(filter ...Filter) Client {
	client.filterManager.RemoveFilter(filter...)
	return client
}
534257
func NewWhileMatchFilter(matchingFilter Filter) *WhileMatchFilter {
	f, err := matchingFilter.ConstructPBFilter()
	if err != nil {
		panic(err)
	}
	return &WhileMatchFilter{
		Filter: f,
	}
}
509526
func NewFilteredQuery(query Query) FilteredQuery {
	q := FilteredQuery{
		query:   query,
		filters: make([]Filter, 0),
	}
	return q
}
593504
func NewResourceTypeFilter(resourceType api.ResourceType, options ...Option) Filter {
	return &filter{filterType: resourceTypeFilter, value: resourceType, options: options}
}
596934
func New(nextHandler Handler, filterFuncs ...FilterFunc) *FilterHandler {
	return &FilterHandler{
		nextHandler: nextHandler,
		filterFuncs: filterFuncs,
	}
}
1211149
func NewEndorsementAnalyzer(gs gossipSupport, pf policyFetcher, pe principalEvaluator, mf chaincodeMetadataFetcher) *endorsementAnalyzer {
	return &endorsementAnalyzer{
		gossipSupport:            gs,
		policyFetcher:            pf,
		principalEvaluator:       pe,
		chaincodeMetadataFetcher: mf,
	}
}
1076485
func NewFilterQueueWithDefaults() *FilterQueue {
	return NewFilterQueue(
		DefaultQueueSeperation,
		DefaultMarkValue,
		DefaultQueueStart,
		DefaultNumberOfQueues,
		DefaultNumberOfQueues,
		DefaultQueueSize,
		DefaultQueueSize,
	)
}
595827
func newFilter(log uint, k int) (f *filter) {
	if log < elemSize {
		panic(fmt.Sprintf("log must be at least %d", elemSize))
	}

	size := uint64(1 << log)
	bins := make([][]uint8, k)  //allocate one more bin
	binSize := size >> elemSize //size of each bin to have size bits
	for i := range bins {
		bins[i] = make([]uint8, binSize)
	}

	return &filter{
		Log:  log,
		Bins: bins,
		K:    k,
		Left: uint64(k) * (1 << (log - 1)),
	}
}