// New constructs a new graph with n vertices, numbered from 0 to n-1, and no edges.
188881
func New(n int) *Mutable {
	return &Mutable{edges: make([]map[int]int64, n)}
}
653131
func New(prefix string, logger log.Logger) *Graphite {
	return &Graphite{
		prefix:     prefix,
		counters:   map[string]*Counter{},
		gauges:     map[string]*Gauge{},
		histograms: map[string]*Histogram{},
		logger:     logger,
	}
}
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
}
109756
func New(fw ChoriaProvider) (n *Notifier, err error) {
	n = &Notifier{
		fw:     fw,
		logger: fw.Logger("machine"),
	}

	return n, nil
}
153389
func New() *Builder {
	b := &Builder{}

	b.info.Write([]byte{
		0x0, 0x0, 0x0, 0x0, // length
		0x4, 0x0, // version
		0x0, 0x0, 0x0, 0x0, // debug_abbrev_offset
		0x8, // address_size
	})

	b.TagOpen(dwarf.TagCompileUnit, "go")
	b.Attr(dwarf.AttrLanguage, uint8(22))

	return b
}
1036386
func New(path string) *Node {
	return &Node{path: path, vpaths: make(map[string]bool)}
}
59712
func NewRandomGraph(n int) (generator.Generator, error) {
	if n < 1 {
		return nil, fmt.Errorf("invalid number of nodes %d<1", n)
	}
	nt, err := node.NewType("/gn")
	if err != nil {
		return nil, err
	}
	p, err := predicate.NewImmutable("follow")
	if err != nil {
		return nil, err
	}
	return &randomGraph{
		nodes:     n,
		nodeType:  nt,
		predicate: p,
	}, nil
}
95322
func (s *memoryStore) NewGraph(ctx context.Context, id string) (storage.Graph, error) {
	g := &memory{
		id:    id,
		idx:   make(map[string]*triple.Triple, initialAllocation),
		idxS:  make(map[string]map[string]*triple.Triple, initialAllocation),
		idxP:  make(map[string]map[string]*triple.Triple, initialAllocation),
		idxO:  make(map[string]map[string]*triple.Triple, initialAllocation),
		idxSP: make(map[string]map[string]*triple.Triple, initialAllocation),
		idxPO: make(map[string]map[string]*triple.Triple, initialAllocation),
		idxSO: make(map[string]map[string]*triple.Triple, initialAllocation),
	}

	s.rwmu.Lock()
	defer s.rwmu.Unlock()
	if _, ok := s.graphs[id]; ok {
		return nil, fmt.Errorf("memory.NewGraph(%q): graph already exists", id)
	}
	s.graphs[id] = g
	return g, nil
}
24518
func new(err error, skip int) *Error {
	return &Error{
		Err:        err,
		stackTrace: stacktrace(err, skip+1),
		info:       map[string]interface{}{},
	}
}
976217
func (d *database) CreateGraph(ctx context.Context, name string, options *CreateGraphOptions) (Graph, error) {
	input := createGraphOptions{
		Name: name,
	}
	if options != nil {
		input.OrphanVertexCollections = options.OrphanVertexCollections
		input.EdgeDefinitions = options.EdgeDefinitions
		input.IsSmart = options.IsSmart
		if options.SmartGraphAttribute != "" || options.NumberOfShards != 0 {
			input.Options = &createGraphAdditionalOptions{
				SmartGraphAttribute: options.SmartGraphAttribute,
				NumberOfShards:      options.NumberOfShards,
			}
		}
	}
	req, err := d.conn.NewRequest("POST", path.Join(d.relPath(), "_api/gharial"))
	if err != nil {
		return nil, WithStack(err)
	}
	if _, err := req.SetBody(input); err != nil {
		return nil, WithStack(err)
	}
	resp, err := d.conn.Do(ctx, req)
	if err != nil {
		return nil, WithStack(err)
	}
	if err := resp.CheckStatus(201, 202); err != nil {
		return nil, WithStack(err)
	}
	g, err := newGraph(name, d)
	if err != nil {
		return nil, WithStack(err)
	}
	return g, nil
}
35613
func New(doc *goquery.Document) *GopenGraph {
	mg := new(GopenGraph)
	mg.MandatoryAttrs = []string{"og:title", "og:type", "og:image", "og:url"}
	mg.PopulateOgTags(doc)
	mg.PopulateAttrs(doc)
	mg.Url = doc.Url.String()

	return mg
}
1114639
func New(name, root string, options []string) (graphdriver.Driver, error) {
	mutex.Lock()
	defer mutex.Unlock()

	if _, ok := instances[name]; ok {
		return nil, ErrExist
	}

	if initFunc, exists := drivers[name]; exists {
		driver, err := initFunc(root, options, nil, nil)
		if err != nil {
			return nil, err
		}
		instances[name] = driver
		return driver, err
	}
	return nil, ErrNotSupported
}
94592
func (a Algorithm) New() Digester {
	return &digester{
		alg:  a,
		hash: a.Hash(),
	}
}
593916
func New(na ...string) (log Logger) {
	s := strings.Join(na, DefaultSepperator)
	return Logger(s)
}
1175191
func New() (*Conn, error) {
	c := new(Conn)

	if err := c.initConnection(); err != nil {
		return nil, err
	}

	return c, nil
}
1116533
func New(transport peer.Transport, opts ...ListOption) *List {
	cfg := defaultListConfig
	for _, o := range opts {
		o(&cfg)
	}

	plOpts := []peerlist.ListOption{
		peerlist.Capacity(cfg.capacity),
	}
	if !cfg.shuffle {
		plOpts = append(plOpts, peerlist.NoShuffle())
	}

	nextRandFn := nextRand(cfg.seed)
	if cfg.nextRand != nil {
		// only true in tests
		nextRandFn = cfg.nextRand
	}

	return &List{
		List: peerlist.New(
			"fewest-pending-requests",
			transport,
			&pendingHeap{
				nextRand: nextRandFn,
			},
			plOpts...,
		),
	}
}
342780
func NewUndirectedGraph(self, absent float64) *UndirectedGraph {
	return &UndirectedGraph{
		nodes: make(map[int]graph.Node),
		edges: make(map[int]edgeHolder),

		self:   self,
		absent: absent,
	}
}