// GetArity returns the number of args a function referred to by ref takes. If
// ref refers to built-in function, the built-in declaration is consulted,
// otherwise, the ref is used to perform a ruleset lookup.
427951
func (c *Compiler) GetArity(ref Ref) int {
	if bi := BuiltinMap[ref.String()]; bi != nil {
		return len(bi.Decl.Args())
	}
	rules := c.GetRulesExact(ref)
	if len(rules) == 0 {
		return -1
	}
	return len(rules[0].Head.Args)
}
447119
func (v Float32) Get(deflt float32) float32 {
	if !v.Defined {
		return deflt
	}
	return v.V
}
377519
func (v Optional) Get(deflt A) A {
	if !v.Defined {
		return deflt
	}
	return v.V
}
392477
func (ec *Cache) GetOrSet(k string, newValue interface{}, size uint64, expire int32) (item interface{}) {
	ec.Lock()
	v, ok := ec.cache[k]
	if !ok || v.validUntil.Before(timeNow()) {
		ec.actualSet(k, newValue, size, expire)
		ec.Unlock()
		return newValue
	}
	ec.Unlock()
	return v.data
}
591117
func (ai *AtomicInt) Get() int {
	res := int(atomic.LoadInt64(&ai.val))
	return res
}
1103733
func GetIntErr(key string, args ...interface{}) (int, error) {
	return std.GetIntErr(key, args...)
}
451264
func (qri *Map) Get(ruleSource string) (*Rules, error) {
	qri.mu.Lock()
	defer qri.mu.Unlock()
	if ruleset, ok := qri.queryRulesMap[ruleSource]; ok {
		return ruleset.Copy(), nil
	}
	return New(), errors.New("Rule source identifier " + ruleSource + " is not valid")
}
246482
func (a *argGroup) GetArg(name string) *ArgClause {
	for _, arg := range a.args {
		if arg.name == name {
			return arg
		}
	}
	return nil
}
851562
func getLess(t reflect.Type) (f func(x, y interface{}) bool) {
	switch t.Kind() {
	case reflect.Bool:
		f = func(x, y interface{}) bool { return !x.(bool) && y.(bool) }
	case reflect.Int:
		f = func(x, y interface{}) bool { return x.(int) < y.(int) }
	case reflect.Int8:
		f = func(x, y interface{}) bool { return x.(int8) < y.(int8) }
	case reflect.Int16:
		f = func(x, y interface{}) bool { return x.(int16) < y.(int16) }
	case reflect.Int32:
		f = func(x, y interface{}) bool { return x.(int32) < y.(int32) }
	case reflect.Int64:
		f = func(x, y interface{}) bool { return x.(int64) < y.(int64) }
	case reflect.Uint:
		f = func(x, y interface{}) bool { return x.(uint) < y.(uint) }
	case reflect.Uint8:
		f = func(x, y interface{}) bool { return x.(uint8) < y.(uint8) }
	case reflect.Uint16:
		f = func(x, y interface{}) bool { return x.(uint16) < y.(uint16) }
	case reflect.Uint32:
		f = func(x, y interface{}) bool { return x.(uint32) < y.(uint32) }
	case reflect.Uint64:
		f = func(x, y interface{}) bool { return x.(uint64) < y.(uint64) }
	case reflect.Float32:
		f = func(x, y interface{}) bool { return x.(float32) < y.(float32) }
	case reflect.Float64:
		f = func(x, y interface{}) bool { return x.(float64) < y.(float64) }
	case reflect.String:
		f = func(x, y interface{}) bool { return x.(string) < y.(string) }
	case reflect.TypeOf(time.Time{}).Kind():
		f = func(x, y interface{}) bool { return x.(time.Time).Before(y.(time.Time)) }
	default:
		panic(fmt.Sprintf("sortmap: unsupported type: %s", t))
	}
	return
}
688109
func (cs *cachedSource) getRef() *cachedSourceRef {
	ref := &cachedSourceRef{cachedSource: cs}
	cs.refs[ref] = struct{}{}
	return ref
}
794828
func (mr *MockProviderMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockProvider)(nil).Get), arg0, arg1)
}
1269277
func (c *ifFunctionClass) getFunction(ctx sessionctx.Context, args []Expression) (sig builtinFunc, err error) {
	if err = c.verifyArgs(args); err != nil {
		return nil, err
	}
	retTp := InferType4ControlFuncs(args[1].GetType(), args[2].GetType())
	evalTps := retTp.EvalType()
	bf := newBaseBuiltinFuncWithTp(ctx, args, evalTps, types.ETInt, evalTps, evalTps)
	retTp.Flag |= bf.tp.Flag
	bf.tp = retTp
	switch evalTps {
	case types.ETInt:
		sig = &builtinIfIntSig{bf}
		sig.setPbCode(tipb.ScalarFuncSig_IfInt)
	case types.ETReal:
		sig = &builtinIfRealSig{bf}
		sig.setPbCode(tipb.ScalarFuncSig_IfReal)
	case types.ETDecimal:
		sig = &builtinIfDecimalSig{bf}
		sig.setPbCode(tipb.ScalarFuncSig_IfDecimal)
	case types.ETString:
		sig = &builtinIfStringSig{bf}
		sig.setPbCode(tipb.ScalarFuncSig_IfString)
	case types.ETDatetime, types.ETTimestamp:
		sig = &builtinIfTimeSig{bf}
		sig.setPbCode(tipb.ScalarFuncSig_IfTime)
	case types.ETDuration:
		sig = &builtinIfDurationSig{bf}
		sig.setPbCode(tipb.ScalarFuncSig_IfDuration)
	case types.ETJson:
		sig = &builtinIfJSONSig{bf}
		sig.setPbCode(tipb.ScalarFuncSig_IfJson)
	}
	return sig, nil
}
453599
func (v Int16) Get(deflt int16) int16 {
	if !v.Defined {
		return deflt
	}
	return v.V
}
1025637
func (args Arguments) Get(index int) interface{} {
	if index+1 > len(args) {
		panic(fmt.Sprintf("assert: arguments: Cannot call Get(%d) because there are %d argument(s).", index, len(args)))
	}
	return args[index]
}
274383
func (a Args) Get(n int) string {
	if len(a) > n {
		return a[n]
	}
	return ""
}
1107074
func (fi *fieldInfo) getValue(a reflect.Value) interface{} {
	for _, i := range fi.path {
		a = a.Field(i)
		if a.Kind() == reflect.Ptr {
			if a.IsNil() {
				return nil
			}
			a = a.Elem()
		}
	}
	return a.Interface()
}
1225838
func (r *Ref) tryGetVal() interface{} {
	if r.tvals == nil {
		return nil
	}
	return r.tvals.val
}