// NewFilter returns a new instance of Filter using m bits and k hash functions.
// If m is not a power of two then it is rounded to the next highest power of 2.
427333
func NewFilter(m uint64, k uint64) *Filter {
	m = pow2(m)
	return &Filter{k: k, b: make([]byte, m>>3), mask: m - 1}
}
794168
func NewFilterDeleter(kv kvdb.Kvdb, options ...Option) (FilterDeleter, error) {
	return newManager(kv, options...)
}
648391
func NewMultiRowRangeFilter(rowRangeList []*RowRange) *MultiRowRangeFilter {
	rangeList := make([]*pb.RowRange, len(rowRangeList))
	for i, rr := range rowRangeList {
		rangeList[i] = (*pb.RowRange)(rr)
	}
	return &MultiRowRangeFilter{
		RowRangeList: rangeList,
	}
}
323138
func NewCustomBicubicFilter(b, c float64) Filter {
	f := &bicubic{}
	f.a = 1 - b/3
	f.b = -3 + 2*b + c
	f.c = 2 - 3*b/2 - c
	f.d = 4*b/3 + 4*c
	f.e = -2*b - 8*c
	f.f = b + 5*c
	f.g = -b/6 - c
	return f
}
1001567
func (rs *routes) AddFilter(fn func(*RouteTrace) *RouteTrace) {
	rs.filters = append(rs.filters, fn)
}
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
}
2589
func (fm *filterManager) AddFilter(filter ...Filter) {
	fm.fmLocker.Lock()
	fm.addFilter(filter...)
	fm.fmLocker.Unlock()
}
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),
	}
}
276090
func (q *Query) AddFilter(f Filter) *Query {
	if q.Filters == nil {
		q.Filters = make([]Filter, 0)
	}
	q.Filters = append(q.Filters, f)
	return q
}
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
}
305950
func NewPkgFilter(count uint16) *PkgFilter {
	// We add 7 to ensure that the integer division yields properly rounded
	// values.
	filterLen := (count + 7) / 8

	return &PkgFilter{
		count:  count,
		filter: make([]byte, filterLen),
	}
}
551419
func NewBinaryConvertFilter() *BinaryConvertFilter {
	ret := &BinaryConvertFilter{
		make([]base.Attribute, 0),
		make([]base.FilteredAttribute, 0),
		make(map[base.Attribute]bool),
		make(map[base.Attribute]map[uint64]base.Attribute),
	}
	return ret
}
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)
}
773965
func NewMinSeverityFilter(minSev api.SeverityType) Filter {
	return &filter{filterType: minSeverityFilter, value: minSev}
}
85402
func (s *Set) Filter(fn func(interface{}) bool) *Set {
	// Create a set to return with elements which match filter function
	filterSet := New()

	// Enumerate all elements and apply the function
	for _, e := range s.Enumerate() {
		// Apply the function, add elements which it matches
		if fn(e) {
			filterSet.Add(e)
		}
	}

	return filterSet
}
1303732
func NewFilterNode(filters []string, body Node, p Pos) *FilterNode {
	return &FilterNode{p, TrimmableNode{}, filters, body}
}
825067
func AddNewerFilter(q *ds.Query, t time.Time) *ds.Query {
	return q.Gt("Created", t.UTC()).Order("-Created")
}