// New creates a new quadtree for the given bound. Added points
// must be within this bound.
335855
func New(bound *geo.Bound, preallocateSize ...int) *Quadtree {
	qt := &Quadtree{
		Threshold: math.Max(bound.Width(), bound.Height()) / float64(1<<12),
		bound:     bound,
	}
	if len(preallocateSize) == 1 {
		qt.freeNodes = make([]node, preallocateSize[0], preallocateSize[0])

	}
	return qt
}
1261972
func (e *domEngine) New(c Compo) error {
	e.once.Do(e.init)
	e.mutex.Lock()
	defer e.mutex.Unlock()

	e.close()

	if err := e.render(c); err != nil {
		return err
	}

	ic := e.compos[c]
	e.rootID = ic.ID

	e.changes = append(e.changes, change{
		Action: setRoot,
		NodeID: ic.ID,
	})

	return e.sync()
}
486959
func New(dims, maxEntries int) *RTree {
	if dims <= 0 {
		panic("invalid dimensions")
	}

	tr := &RTree{}
	tr.dims = dims
	tr.maxEntries = int(math.Max(4, float64(maxEntries)))
	tr.minEntries = int(math.Max(2, math.Ceil(float64(tr.maxEntries)*0.4)))
	tr.data = tr.createNode(nil)
	return tr
}
808707
func New() db.FileSystem {
	return &fileSystem{
		root: &node{
			children: make(map[string]*node),
			isDir:    true,
		},
	}
}
182182
func New(start, end int, zero Equaler) (*Vector, error) {
	if start >= end {
		return nil, ErrZeroLength
	}
	v := &Vector{
		Zero: zero,
		min: &position{
			pos: start,
			val: zero,
		},
		max: &position{
			pos: end,
			val: nil,
		},
	}
	v.t.Insert(v.min)
	v.t.Insert(v.max)

	return v, nil
}
274067
func New() *T {
	return &T{
		new:    make(map[string]int64),
		active: make(map[string]int64),
		idle:   make(map[string]int64),
	}
}
1147550
func New(w io.Writer, opts *BuilderOpts) (*Builder, error) {
	return newBuilder(w, opts)
}
491202
func (db *DB) New(name []byte) (*Bucket, error) {
	err := db.Update(func(tx *bolt.Tx) error {
		_, err := tx.CreateBucketIfNotExists(name)
		if err != nil {
			return err
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	return &Bucket{db, name}, nil
}
947733
func New() ctx.C {
	initC.Do(func() {
		initSig.Do(initSigCh)

		dc := make(chan struct{})
		c = dc

		go func() {
			select {
			case <-sigCh:
				close(dc)
			case <-c.Done():
			}
		}()
	})

	return c
}
1119035
func New(as map[string]string) Annotation {
	newA := Annotation{}
	if as == nil {
		return newA
	}
	for k, v := range as {
		newA.Add(k, v)
	}
	return newA
}
407128
func New() *SkipList {
	comparator := func(left, right interface{}) bool {
		return left.(Ordered).LessThan(right.(Ordered))
	}
	return NewCustomMap(comparator)

}
1069095
func (p *ListParam) New() Param {
	return &ListParam{p.paramCommon, p.el, nil}
}
438258
func New(name string) *Tree {
	return &Tree{
		Name:  name,
		mixin: map[string]*MixinNode{},
		block: map[string]*ListNode{},
	}
}
435766
func New() *StandardDeck {
	ans := new(StandardDeck)

	// add all cards from all suits
	for _, sv := range card.AllSuits {
		for _, vv := range card.AllValues {
			c := card.Card{Suit: sv, Value: vv}
			ans.cards = append(ans.cards, &c)
		}
	}

	return ans
}
945126
func New(k int) *Tree {
	var t *Tree
	for _, v := range rand.Perm(10) {
		t = insert(t, (1+v)*k)
	}
	return t
}
980170
func New(db *gitobj.ObjectDatabase, t *gitobj.Tree) (*Tree, error) {
	children := make(map[string]*Tree)
	lines, _, err := linesInTree(db, t)
	if err != nil {
		return nil, err
	}

	for _, entry := range t.Entries {
		if entry.Type() != gitobj.TreeObjectType {
			continue
		}

		// For every entry in the current tree, parse its sub-trees to
		// see if they might contain a .gitattributes.
		t, err := db.Tree(entry.Oid)
		if err != nil {
			return nil, err
		}

		at, err := New(db, t)
		if err != nil {
			return nil, err
		}

		if len(at.Children) > 0 || len(at.Lines) > 0 {
			// Only include entries that have either (1) a
			// .gitattributes in their tree, or (2) a .gitattributes
			// in a sub-tree.
			children[entry.Name] = at
		}
	}

	return &Tree{
		Lines:    lines,
		Children: children,
	}, nil
}
433954
func New(config *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
	if config == nil {
		klog.Error("MultipointExample configuration cannot be empty")
		return nil, fmt.Errorf("MultipointExample configuration cannot be empty")
	}
	mp := MultipointExample{
		mpState: make(map[int]string),
	}
	return &mp, nil
}