// IntoSingleItemImplied sets the provided boolean pointer to true if the Builder input
// implies a single item, or multiple.
354115
func (r *Result) IntoSingleItemImplied(b *bool) *Result {
	*b = r.singleItemImplied
	return r
}
499319
func (b *BindObject) IsAssignable(to reflect.Type) bool {
	return equalTypes(b.Type, to)
}
671238
func IsZeroOfUnderlyingType(x interface{}) bool {
	return reflect.DeepEqual(x, reflect.Zero(reflect.TypeOf(x)).Interface())
}
442353
func IsPrimitiveValue(v reflect.Value) bool {
	switch v.Kind() {
	case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
		reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
		reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128:
		return true

	// The less-obvious cases!
	case reflect.String, reflect.Slice, reflect.Array:
		return false

	case reflect.Ptr, reflect.Interface, reflect.Chan, reflect.Func, reflect.Map, reflect.Struct, reflect.UnsafePointer:
		return false

	default:
		glog.Fatalf("Unhandled kind: %v", v.Kind())
		return false
	}
}
1317285
func NewTimings(name string) *Timings {
	t := &Timings{histograms: make(map[string]*Histogram)}
	if name != "" {
		Publish(name, t)
	}
	return t
}
597018
func init() {
	lbls := make([]lingo.DependencyType, lingo.MAXDEPTYPE)

	for i := 0; i < int(lingo.MAXDEPTYPE); i++ {
		lbls[i] = lingo.DependencyType(i)
	}

	transitions = buildTransitions(lbls)
	MAXTRANSITION = len(transitions)
}
353638
func (b *builtinStringStringTimeDiffSig) evalDuration(row chunk.Row) (d types.Duration, isNull bool, err error) {
	lhs, isNull, err := b.args[0].EvalString(b.ctx, row)
	if isNull || err != nil {
		return d, isNull, err
	}

	rhs, isNull, err := b.args[1].EvalString(b.ctx, row)
	if isNull || err != nil {
		return d, isNull, err
	}

	sc := b.ctx.GetSessionVars().StmtCtx
	fsp := b.tp.Decimal
	lhsDur, lhsTime, lhsIsDuration, err := convertStringToDuration(sc, lhs, fsp)
	if err != nil {
		return d, true, err
	}

	rhsDur, rhsTime, rhsIsDuration, err := convertStringToDuration(sc, rhs, fsp)
	if err != nil {
		return d, true, err
	}

	if lhsIsDuration != rhsIsDuration {
		return d, true, nil
	}

	if lhsIsDuration {
		d, isNull, err = calculateDurationTimeDiff(b.ctx, lhsDur, rhsDur)
	} else {
		d, isNull, err = calculateTimeDiff(sc, lhsTime, rhsTime)
	}

	return d, isNull, err
}
761632
func IsTypeTemporal(tp byte) bool {
	switch tp {
	case mysql.TypeDuration, mysql.TypeDatetime, mysql.TypeTimestamp,
		mysql.TypeDate, mysql.TypeNewDate:
		return true
	}
	return false
}
288670
func (enc *Encoder) AddIntKeyOmitEmpty(key string, v int) {
	enc.IntKeyOmitEmpty(key, v)
}
455334
func (s *StdoutClient) PrecisionTiming(stat string, delta time.Duration) error {
	return s.send(stat, "%.6f|ms", float64(delta)/float64(time.Millisecond))
}
887798
func (prof *Profiler) calculateUtilization(cur *stats.CPUStats) *CPUUtil {
	u := &CPUUtil{
		Timestamp:  cur.Timestamp,
		TimeDelta:  cur.Timestamp - prof.prior.Timestamp,
		BTimeDelta: int32(cur.Timestamp/1000000000 - cur.BTime),
		CtxtDelta:  cur.Ctxt - prof.prior.Ctxt,
		Processes:  int32(cur.Processes),
		CPU:        make([]Utilization, len(cur.CPU)),
	}
	var dUser, dNice, dSys, dIdle, tot float32
	// Rest of the calculations are per core
	for i := 0; i < len(cur.CPU); i++ {
		v := Utilization{ID: cur.CPU[i].ID}
		dUser = float32(cur.CPU[i].User - prof.prior.CPU[i].User)
		dNice = float32(cur.CPU[i].Nice - prof.prior.CPU[i].Nice)
		dSys = float32(cur.CPU[i].System - prof.prior.CPU[i].System)
		dIdle = float32(cur.CPU[i].Idle - prof.prior.CPU[i].Idle)
		tot = dUser + dNice + dSys + dIdle
		v.Usage = (dUser + dNice + dSys) / tot * float32(cur.ClkTck)
		v.User = dUser / tot * float32(cur.ClkTck)
		v.Nice = dNice / tot * float32(cur.ClkTck)
		v.System = dSys / tot * float32(cur.ClkTck)
		v.Idle = dIdle / tot * float32(cur.ClkTck)
		v.IOWait = float32(cur.CPU[i].IOWait-prof.prior.CPU[i].IOWait) / tot * float32(cur.ClkTck)
		u.CPU[i] = v
	}
	return u
}
1281393
func (d *DisallowFlunder) ValidateInitialization() error {
	if d.lister == nil {
		return fmt.Errorf("missing fischer lister")
	}
	return nil
}
597651
func (s *Mpeg2Settings) SetTemporalAdaptiveQuantization(v string) *Mpeg2Settings {
	s.TemporalAdaptiveQuantization = &v
	return s
}
1105339
func (b *builtinDurationAnyValueSig) evalDuration(row chunk.Row) (types.Duration, bool, error) {
	return b.args[0].EvalDuration(b.ctx, row)
}
1349963
func (p *ProtoCommands) InitialPreCondition(state State) bool {
	if p.InitialPreConditionFunc != nil {
		return p.InitialPreConditionFunc(state)
	}
	return true
}
139570
func (DeducedTypeConverter) TypedToObject(value typed.TypedValue) (runtime.Object, error) {
	return valueToObject(value.AsValue())
}
980995
func (q Query) TakeWhileIndexedT(predicateFn interface{}) Query {
	whereFunc, err := newGenericFunc(
		"TakeWhileIndexedT", "predicateFn", predicateFn,
		simpleParamValidator(newElemTypeSlice(new(int), new(genericType)), newElemTypeSlice(new(bool))),
	)
	if err != nil {
		panic(err)
	}

	predicateFunc := func(index int, item interface{}) bool {
		return whereFunc.Call(index, item).(bool)
	}

	return q.TakeWhileIndexed(predicateFunc)
}