// OneIntOf returns one of the passed ints.
323991
func (g *Generator) OneIntOf(values ...int) int {
	i := g.Int(0, len(values)-1)
	return values[i]
}
1220929
func InstanceOf(value interface{}, object *js.Object) bool {
	return js.Global.Get("$jsbuiltin$").Call("instanceoffunc", value, object).Bool()
}
142514
func IncrPowOf(a []float64, s float64, incr []float64) {
	incr = incr[:len(a)]
	for i, v := range a {
		incr[i] += math.Pow(v, s)
	}
}
675589
func (g *Generator) OneDurationOf(values ...time.Duration) time.Duration {
	i := g.Int(0, len(values)-1)
	return values[i]
}
752109
func (c *Distconf) Int(key string, defaultVal int64) *Int {
	c.grabInfo(key)
	s := &intConf{
		defaultVal: defaultVal,
		Int: Int{
			currentVal: defaultVal,
		},
	}
	// Note: in race conditions 's' may not be the thing actually returned
	ret, okCast := c.createOrGet(key, s).(*intConf)
	if !okCast {
		c.Logger.Log(logkey.DistconfKey, key, "Registering key with multiple types!  FIX ME!!!!")
		return nil
	}
	return &ret.Int
}
337550
func (s *Session) Int(key string) int {
	s.RLock()
	defer s.RUnlock()

	v, ok := s.data[key]
	if !ok {
		return 0
	}

	value, ok := v.(int)
	if !ok {
		return 0
	}
	return value
}
394376
func (r *Rows) one(a interface{}) error {
	defer r.Close()

	if !r.Next() {
		if err := r.Err(); err != nil {
			return err
		}
		return sql.ErrNoRows
	}

	var err error

	rt := reflect.TypeOf(a)
	if rt.Kind() == reflect.Ptr && rt.Elem().Kind() == reflect.Map {
		// pointer to map
		v := indirect(reflect.ValueOf(a))
		if v.IsNil() {
			v.Set(reflect.MakeMap(v.Type()))
		}
		a = v.Interface()
		rt = reflect.TypeOf(a)
	}

	if rt.Kind() == reflect.Map {
		v, ok := a.(NullStringMap)
		if !ok {
			return VarTypeError("must be a NullStringMap")
		}
		if v == nil {
			return VarTypeError("NullStringMap is nil")
		}
		err = r.ScanMap(v)
	} else {
		err = r.ScanStruct(a)
	}

	if err != nil {
		return err
	}

	return r.Close()
}
458981
func (g *Generator) OneRuneOf(values string) rune {
	runes := []rune(values)
	i := g.Int(0, len(runes)-1)
	return runes[i]
}
967304
func IndexOfInt(a []int, x int) int {
	return indexOf(len(a), func(i int) bool { return a[i] == x })
}
257562
func (nc *NumberConstraint) MultipleOf(n float64) *NumberConstraint {
	nc.applyMultipleOf = true
	nc.multipleOf = n
	return nc
}
842312
func (result ErrorResults) OneError() error {
	if n := len(result.Results); n != 1 {
		return fmt.Errorf("expected 1 result, got %d", n)
	}
	if err := result.Results[0].Error; err != nil {
		return err
	}
	return nil
}
920404
func NewIntValue(i int) Value {
	value := &Value{}
	value.StoreInt(i)
	return *value
}
499211
func (f *FlagSet) Int(name string, value int, usage string) *int {
	p := new(int)
	f.IntVar(p, name, value, usage)
	return p
}
675909
func ConvertToInt(target string, def int) int {
	fo, err := strconv.Atoi(target)
	if err != nil {
		return def
	}
	return fo
}
318316
func OnesCount(x uint) int {
	if UintSize == 32 {
		return OnesCount32(uint32(x))
	}
	return OnesCount64(uint64(x))
}
297387
func ValueOf(rootValue reflect.Value) Value {
	if !rootValue.IsValid() {
		return Value{}
	}
	return Value{
		rootValue: rootValue,
		rootType:  TypeOf(rootValue.Type()),
	}
}
1340428
func (c *ConfigLookup) GetInt(key string) int {
	value, ok := c.Lookup(key)
	if !ok {
		return 0
	}
	return cast.ToInt(value)
}