// NewNamedValueFloat returns a new NamedValueFloat
778036
func NewNamedValueFloat(TIME_BOOT_MS uint32, VALUE float32, NAME [10]uint8) *NamedValueFloat {
	m := NamedValueFloat{}
	m.TIME_BOOT_MS = TIME_BOOT_MS
	m.VALUE = VALUE
	m.NAME = NAME
	return &m
}
618376
func NewValue(L *lua.LState, value interface{}) lua.LValue {
	// Nils should return immediately
	if value == nil {
		return lua.LNil
	}

	// if it is a LValue already, return it without delay
	if lval, ok := value.(lua.LValue); ok {
		return lval
	}

	switch v := value.(type) {
	case string:
		return lua.LString(v)
	case int:
		return lua.LNumber(float64(v))
	case uint:
		return lua.LNumber(float64(v))
	case int8:
		return lua.LNumber(float64(v))
	case uint8:
		return lua.LNumber(float64(v))
	case int16:
		return lua.LNumber(float64(v))
	case uint16:
		return lua.LNumber(float64(v))
	case int32:
		return lua.LNumber(float64(v))
	case uint32:
		return lua.LNumber(float64(v))
	case int64:
		return lua.LNumber(float64(v))
	case uint64:
		return lua.LNumber(float64(v))
	case float32:
		return lua.LNumber(float64(v))
	case float64:
		return lua.LNumber(v)
	case bool:
		return lua.LBool(v)
	case map[interface{}]interface{}:
		luaMap := &LuaMap{m: v}
		ud := L.NewUserData()
		ud.Value = luaMap
		L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName))
		return ud

	case []interface{}:
		luaList := &LuaList{l: v}
		ud := L.NewUserData()
		ud.Value = luaList
		L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName))
		return ud
	}

	// check for array and map
	rv := reflect.ValueOf(value)
	switch rv.Kind() {
	case reflect.Array, reflect.Slice:
		l := rv.Len()
		arr := make([]interface{}, l)
		for i := 0; i < l; i++ {
			arr[i] = rv.Index(i).Interface()
		}

		return NewValue(L, arr)
	case reflect.Map:
		l := rv.Len()
		amap := make(map[interface{}]interface{}, l)
		for _, i := range rv.MapKeys() {
			amap[i.Interface()] = rv.MapIndex(i).Interface()
		}

		return NewValue(L, amap)
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return NewValue(L, reflect.ValueOf(value).Int())
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32:
		return NewValue(L, int64(reflect.ValueOf(value).Uint()))
	case reflect.String:
		return NewValue(L, rv.String())
	case reflect.Float32, reflect.Float64:
		return NewValue(L, rv.Float())
	case reflect.Bool:
		return NewValue(L, rv.Bool())
	}

	panic(fmt.Sprintf("unrecognized data type for lua: %#v\n", value))
}
225298
func NewNamespacedKV(db *Lowlevel, prefix string) *NamespacedKV {
	prefixBs := []byte(prefix)
	// After the conversion from string the cap will be larger than the len (in Go 1.11.5,
	// 32 bytes cap for small strings). We need to cut it down to ensure append() calls
	// on the prefix make a new allocation.
	prefixBs = prefixBs[:len(prefixBs):len(prefixBs)]
	return &NamespacedKV{
		db:     db,
		prefix: prefixBs,
	}
}
890230
func NewFloat64Flag(fl cli.Float64Flag) *Float64Flag {
	return &Float64Flag{Float64Flag: fl, set: nil}
}
697264
func NewNamespaceNamer(shortNames bool) *NamespaceNamer {
	return &NamespaceNamer{shortNames: shortNames, re: regexp.MustCompile(invalidTokensExpr)}
}
489663
func NewFloat64(val float64, p *float64) *Float64 {
	*p = val
	return (*Float64)(p)
}
55972
func NewFloatTypeParserToVar(variable *float64) *FloatTypeParser {
	parser := new(FloatTypeParser)
	parser.setter = func(value float64) {
		*variable = value
	}
	return parser
}
505984
func NewNameBasedMD5(namespace, name string) (UUID, error) {
	u, err := md5.NewUUID(namespace, name)
	if err != nil {
		return Nil, err
	}

	uuid := UUID{}
	copy(uuid[:], u)

	return uuid, nil
}
843821
func NewValueDouble(v float64) Value {
	return Value{
		typ:     TDouble,
		tnumber: math.Float64bits(v),
	}
}
520476
func NewValueSet(values ...Value) ValueSet {
	set := make(ValueSet)

	for _, value := range values {
		set.Add(value)
	}

	return set
}
278649
func NewNamespace(NSName string) *Namespace {
	return &Namespace{
		Namespace: NSName,
		Aliases: map[string]map[string]string{
			"":         {},
			"const":    {},
			"function": {},
		},
	}
}
1241342
func NewParamValue(PARAM_VALUE float32, PARAM_COUNT uint16, PARAM_INDEX uint16, PARAM_ID [16]uint8, PARAM_TYPE uint8) *ParamValue {
	m := ParamValue{}
	m.PARAM_VALUE = PARAM_VALUE
	m.PARAM_COUNT = PARAM_COUNT
	m.PARAM_INDEX = PARAM_INDEX
	m.PARAM_ID = PARAM_ID
	m.PARAM_TYPE = PARAM_TYPE
	return &m
}
699387
func nameOfValue(t *ast.ValueSpec) string {
	if len(t.Names) != 1 {
		fmt.Println("unexpected names", t.Names)
		panic("unexpected names")
	}
	return t.Names[0].Name
}
1227934
func EqNamed(column, name string) Cmp {
	return Cmp{
		op:     eq,
		column: column,
		value:  param(name),
	}
}
1019898
func NewFloatResult(val float64, err error) *FloatCmd {
	var cmd FloatCmd
	cmd.val = val
	cmd.setErr(err)
	return &cmd
}
1303773
func (v *variable) floatValue() float64 {
	f, err := strconv.ParseFloat(v.value, 64)
	if err != nil {
		panic("unexpected value " + v.value + " for float ")
	}
	return f
}
325809
func (ctx *context) PostValueFloat64(name string) (float64, error) {
	v := ctx.PostValue(name)
	if v == "" {
		return -1, errUnableToFindPostValue.Format(name)
	}
	return strconv.ParseFloat(v, 64)
}