// GetK returns the K value, or the number of standard deviations above and below
// to band the simple moving average with.
// Typical K value is 2.0.
9409
func (bbs BollingerBandsSeries) GetK(defaults ...float64) float64 {
	if bbs.K == 0 {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return 2.0
	}
	return bbs.K
}
249855
func (v *OrderedValues) GetOk(key []byte) ([]byte, bool) {
	for _, j := range *v {
		if len(j) > 0 && bytes.Equal(j[0], key) {
			if len(j) > 1 {
				return j[1], true
			}
			return nil, true
		}
	}
	return nil, false
}
91229
func (af *avgFunction) GetResult(evalCtx *AggEvaluateContext) (d types.Datum) {
	switch evalCtx.Value.Kind() {
	case types.KindFloat64:
		sum := evalCtx.Value.GetFloat64()
		d.SetFloat64(sum / float64(evalCtx.Count))
		return
	case types.KindMysqlDecimal:
		x := evalCtx.Value.GetMysqlDecimal()
		y := types.NewDecFromInt(evalCtx.Count)
		to := new(types.MyDecimal)
		err := types.DecimalDiv(x, y, to, types.DivFracIncr)
		terror.Log(err)
		frac := af.RetTp.Decimal
		if frac == -1 {
			frac = mysql.MaxDecimalScale
		}
		err = to.Round(to, mathutil.Min(frac, mysql.MaxDecimalScale), types.ModeHalfEven)
		terror.Log(err)
		d.SetMysqlDecimal(to)
	}
	return
}
1046101
func getKey(s, key string) string {
	for _, keyEqualsValue := range strings.Split(s, ",") {
		keyValue := strings.SplitN(keyEqualsValue, "=", 2)
		if len(keyValue) == 2 && keyValue[0] == key {
			return keyValue[1]
		}
	}
	return ""
}
815118
func (a Float64A) Get(vals ...interface{}) (val float64) {
	v := get(a(0).arg(), vals)
	switch v := v.(type) {
	case *float64:
		return *v
	case float64:
		return v
	}
	return
}
1343165
func getCode(s string) string {
	if !strings.HasPrefix(s, `"`) || !strings.HasSuffix(s, `"`) {
		panic(fmt.Sprintf("expected string, got: %s", s))
	}

	return s[1 : len(s)-1]
}
247814
func (c *Config) GetInt(s string) int {
	return c.config.GetInt(s)
}
907154
func (ec *Envcfg) GetInt(key string) int {
	i, _ := strconv.Atoi(ec.GetKey(key))
	return i
}
1335043
func (mo *Mo) GetC(str, ctx string, vars ...interface{}) string {
	// Sync read
	mo.RLock()
	defer mo.RUnlock()

	if mo.contexts != nil {
		if _, ok := mo.contexts[ctx]; ok {
			if mo.contexts[ctx] != nil {
				if _, ok := mo.contexts[ctx][str]; ok {
					return Printf(mo.contexts[ctx][str].Get(), vars...)
				}
			}
		}
	}

	// Return the string we received by default
	return Printf(str, vars...)
}
800751
func (s *Session) GetInt(key string) (int, error) {
	v := s.Get(key)

	if vint, ok := v.(int); ok {
		return vint, nil
	}

	if vstring, sok := v.(string); sok {
		return strconv.Atoi(vstring)
	}

	return -1, fmt.Errorf(errFindParse, "int", key)
}
802224
func (s *Session) GetInt(key string) int {
	r, _ := s.Get(key).(int)
	return r
}
1106939
func (n *Nunchuck) GetRoll() float32 {
	return float32(math.Atan2(float64(n.lastAccelX), float64(n.lastAccelZ)) / math.Pi * 180.0)
}
1346463
func (s *Session) GetInt(key string, def int64) int64 {
	v, ok := s.Values[key]
	if !ok {
		return def
	}

	return v.(int64)
}
265265
func (r *Store) GetInt(key string) (int, error) {
	v, ok := r.GetEntry(key)
	if !ok {
		return 0, errFindParse.Format("int", key)
	}
	return v.IntDefault(-1)
}
40683
func (vals Values) Get(k string) string {
	if vals == nil {
		return ""
	}
	if v, ok := vals[k]; ok && len(v.Values) > 0 {
		return string(v.Values[0].Value)
	}
	return ""
}
1332246
func (e Enum) GetKey(value interface{}) string {
	for k, v := range e {
		if reflect.DeepEqual(v, value) {
			return k
		}
	}
	return ""
}
969911
func (st *stateTracker) GetNick(n string) *Nick {
	st.mu.Lock()
	defer st.mu.Unlock()
	if nk, ok := st.nicks[n]; ok {
		return nk.Nick()
	}
	return nil
}