// NewUV creates a new reference to UV
481276
func NewUV(key string, options ...Option) (*UV, error) {
	k, err := setKey(key)
	if err != nil {
		return nil, err
	}
	u := &UV{
		Key:      k,
		Settings: NewSettings(),
	}

	if err := setOptions(u.Settings, options); err != nil {
		return nil, err
	}
	return u, nil
}
624241
func NewUUID() UUID {
	uuid, err := NewUUIDv4()
	if err != nil {
		// Panic due to compatibility reasons.
		panic(err)
	}
	return uuid
}
555698
func NewUUID62() (string, error) {
	b := make([]byte, 16)
	_, err := randSource.Read(b)
	if err != nil {
		return "", err
	}
	s := fmt.Sprintf("%x", b)
	return ConvertUp(s, base62alphabet), nil
}
429477
func NewUUID() (*UUID, error) {
	u := &UUID{}
	if _, err := rand.Read(u[:]); err != nil {
		return nil, err
	}
	u.setVariant(reservedRFC4122)
	u.setVersion(4)
	return u, nil
}
479248
func (g *rfc4122Generator) NewV2(domain byte) (UUID, error) {
	u, err := g.NewV1()
	if err != nil {
		return Nil, err
	}

	switch domain {
	case DomainPerson:
		binary.BigEndian.PutUint32(u[:], posixUID)
	case DomainGroup:
		binary.BigEndian.PutUint32(u[:], posixGID)
	}

	u[9] = domain

	u.SetVersion(V2)
	u.SetVariant(VariantRFC4122)

	return u, nil
}
726602
func newConfigV3() *configV3 {
	conf := new(configV3)
	conf.Version = "3"
	conf.Aliases = make(map[string]string)
	conf.Hosts = make(map[string]hostConfigV3)
	return conf
}
670269
func NewUniterAPIV8(context facade.Context) (*UniterAPIV8, error) {
	uniterAPI, err := NewUniterAPIV9(context)
	if err != nil {
		return nil, err
	}
	return &UniterAPIV8{
		UniterAPIV9: *uniterAPI,
	}, nil
}
840604
func NewReference(name, assemID, species string, length int, md5 []byte, uri *url.URL) (*Reference, error) {
	if !validLen(length) {
		return nil, errors.New("sam: length out of range")
	}
	if name == "" {
		return nil, errors.New("sam: no name provided")
	}
	var h string
	if md5 != nil {
		if len(md5) != 16 {
			return nil, errors.New("sam: invalid md5 sum length")
		}
		h = string(md5[:])
	}
	return &Reference{
		id:      -1, // This is altered by a Header when added.
		name:    name,
		lRef:    int32(length),
		md5:     h,
		assemID: assemID,
		species: species,
		uri:     uri,
	}, nil
}
1226030
func NewDefaultLlv() (indicator *Llv, err error) {
	timePeriod := 25
	return NewLlv(timePeriod, gotrade.UseClosePrice)
}
1206332
func newConfigV1() *configV1 {
	conf := new(configV1)
	conf.Version = "1.0.0"
	// make sure to allocate map's otherwise Golang
	// exits silently without providing any errors
	conf.Aliases = make(map[string]string)
	conf.Hosts = make(map[string]hostConfigV1)
	return conf
}
1340739
func NewUUIDv1() (UUID, error) {
	uuid := UUID{}
	epoch := int64(0x01b21dd213814000)
	now := uint64(time.Now().UnixNano()/100 + epoch)

	clockSeqRand := [2]byte{}
	rand.Read(clockSeqRand[:])
	clockSeq := binary.LittleEndian.Uint16(clockSeqRand[:])

	timeLow := uint32(now & (0x100000000 - 1))
	timeMid := uint16((now >> 32) & 0xffff)
	timeHighVer := uint16((now >> 48) & 0x0fff)
	clockSeq &= 0x3fff

	binary.LittleEndian.PutUint32(uuid[0:4], timeLow)
	binary.LittleEndian.PutUint16(uuid[4:6], timeMid)
	binary.LittleEndian.PutUint16(uuid[6:8], timeHighVer)
	binary.LittleEndian.PutUint16(uuid[8:10], clockSeq)
	copy(uuid[10:16], cachedMACAddress)

	uuid.setVersion(UUIDv1)
	uuid.setVariant(UUIDVariantRFC4122)
	return uuid, nil
}
635447
func NewUniterAPIV4(context facade.Context) (*UniterAPIV4, error) {
	uniterAPI, err := NewUniterAPIV5(context)
	if err != nil {
		return nil, err
	}
	return &UniterAPIV4{
		UniterAPIV5: *uniterAPI,
	}, nil
}
394278
func NewUnshareFileArg(File string) *UnshareFileArg {
	s := new(UnshareFileArg)
	s.File = File
	return s
}
169113
func NewEnv(v interface{}) (*Env, error) {
	e := &Env{}

	if reflect.TypeOf(v).Kind() != reflect.Ptr {
		return nil, errInvalidValue
	}
	if reflect.ValueOf(v).Elem().Kind() != reflect.Struct {
		return nil, errInvalidValue
	}

	e.SetValue(v)

	if err := e.Parse(); err != nil {
		return e, err
	}

	return e, nil
}
532865
func newUniverse() *universeScope {
	sc := &universeScope{&Scope{nil, 0}, make(map[string]*Scope)}
	sc.block = &block{
		offset: 0,
		scope:  sc.Scope,
		global: true,
		defs:   make(map[string]Def),
	}
	return sc
}
1243080
func NewUnit(component string, templatePaths []string, decorate bool) (uf *unit.UnitFile, err error) {
	template, err := readTemplate(component, templatePaths)
	if err != nil {
		return
	}
	if decorate {
		decorator, err := readDecorator(component)
		if err != nil {
			return nil, err
		}
		uf, err = unit.NewUnitFile(string(template) + "\n" + string(decorator))
	} else {
		uf, err = unit.NewUnitFile(string(template))
	}
	return
}
958670
func NewReference(Variable node.Node, Expression node.Node) *Reference {
	return &Reference{
		FreeFloating: nil,
		Variable:     Variable,
		Expression:   Expression,
	}
}