// NewPopulatedDevEUI returns random DevEUI
517757
func NewPopulatedDevEUI(r Rand) (devEUI *DevEUI) {
	devEUI = &DevEUI{}
	if _, err := randRead(r, devEUI[:]); err != nil {
		panic(fmt.Errorf("types.NewPopulatedDevEUI: %s", err))
	}
	return
}
389367
func NewMigrator(db *sql.DB) *Migrator {
	return &Migrator{
		db:     db,
		Locker: new(sync.Mutex),
	}
}
287166
func NewIDGenerator() *IDGenerator {
	g := new(IDGenerator)
	_, err := rand.Read(g.seed[:])
	if err != nil {
		panic(err)
	}
	return g
}
1372713
func populateNewBindVariable(
	bindVariableName string,
	bindVariableValue *querypb.BindVariable,
	resultBindVariables map[string]*querypb.BindVariable) {
	_, alreadyInMap := resultBindVariables[bindVariableName]
	if alreadyInMap {
		panic(fmt.Sprintf(
			"bindVariable %v already exists in map: %v. bindVariableValue given: %v",
			bindVariableName,
			resultBindVariables,
			bindVariableValue))
	}
	resultBindVariables[bindVariableName] = bindVariableValue
}
663879
func NewPopulatedProtoAddr(r randyPstore) *ProtoAddr {
	a, _ := ma.NewMultiaddr("/ip4/123.123.123.123/tcp/7001")
	return &ProtoAddr{Multiaddr: a}
}
337243
func New(enc Encoder, options ...func(*sonyflake.Settings)) *Generator {
	if enc == nil {
		enc = base58.MustNewEncoder(base58.StdSource())
	}
	s := sonyflake.Settings{}
	for i := range options {
		options[i](&s)
	}
	return &Generator{
		sf:  sonyflake.NewSonyflake(s),
		enc: enc,
	}
}
278691
func New() *NUID {
	n := &NUID{
		seq: prand.Int63n(maxSeq),
		inc: minInc + prand.Int63n(maxInc-minInc),
		pre: make([]byte, preLen),
	}
	n.RandomizePrefix()
	return n
}
1138798
func (f *contextFactory) newId(name string) string {
	return fmt.Sprintf("%s-%s-%d", f.unit.Name(), name, f.rand.Int63())
}
797043
func NewMigrator(db *sql.DB, adapter Migratable, migrationsPath string) (*Migrator, error) {
	return NewMigratorWithLogger(db, adapter, migrationsPath, log.New(os.Stderr, "[gomigrate] ", log.LstdFlags))
}
1272950
func PopulateFromResponse(target interface{}, res *http.Response) error {
	doc, err := goquery.NewDocumentFromResponse(res)
	if err != nil {
		return err
	}
	return Populate(target, doc)
}
437871
func NewMockGeneration(ctrl *gomock.Controller) *MockGeneration {
	mock := &MockGeneration{ctrl: ctrl}
	mock.recorder = &MockGenerationMockRecorder{mock}
	return mock
}
634339
func (fng *FakeNumberGenerator) RandomLocalNumberUSUnique(set map[uint64]int8) (uint64, map[uint64]int8) {
	try := fng.RandomLocalNumberUS()
	_, ok := set[try]
	for ok {
		try := fng.RandomLocalNumberUS()
		_, ok = set[try]
	}
	set[try] = 1
	return try, set
}
475781
func NewUserGenerator(seed int64) *UserGenerator {
	return &UserGenerator{
		g: gen.NewGenerator(seed),
		r: rand.New(rand.NewSource(seed)),
	}
}
452094
func NewDefaultIDGenerator() *IDGenerator {
	globalmachineID.RLock()
	defer globalmachineID.RUnlock()
	if globalmachineID.set {
		return NewIDGenerator(WithMachineID(globalmachineID.id))
	}
	return NewIDGenerator()
}
1047726
func (e *Element) populateElement(node *gcdapi.DOMNode) {
	e.lock.Lock()
	e.node = node
	e.id = node.NodeId
	e.nodeType = node.NodeType
	e.nodeName = strings.ToLower(node.NodeName)
	e.childNodeCount = node.ChildNodeCount
	if node.NodeType == int(TEXT_NODE) {
		e.characterData = node.NodeValue
	}

	e.lock.Unlock()

	for i := 0; i < len(node.Attributes); i += 2 {
		e.updateAttribute(node.Attributes[i], node.Attributes[i+1])
	}

	// close it
	if !e.ready {
		close(e.readyGate)
	}
	e.lock.Lock()
	defer e.lock.Unlock()
	e.ready = true
}
1337288
func NewPopulatedRaw(r intn) *Raw {
	v1 := r.Intn(100)
	data := make([]byte, v1)
	for i := 0; i < v1; i++ {
		data[i] = byte('a')
	}
	d := `{"key":"` + string(data) + `"}`
	raw := Raw([]byte(d))
	return &raw
}
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
}