// Our custom Var will add one to any and all ints
5203
func (env *CustomEnv) Var(ident string) reflect.Value {
	// Note that variables are always pointer values.
	if v := env.Env.Var(ident); v.IsValid() && v.Type().Elem().Kind() == reflect.Int {
		i := v.Elem().Int()
		plusOne := reflect.New(v.Type().Elem()).Elem()
		plusOne.Set(reflect.ValueOf(int(i + 1)))
		return plusOne.Addr()
	} else {
		return v
	}
}
398678
func (cmd *Cmd) SetVar(k string, v interface{}) {
	cmd.context.SetVar(k, v, internal.LocalScope)
}
561854
func varNameForVar(raw config.InterpolatedVariable) string {
	switch v := raw.(type) {
	case *config.ModuleVariable:
		return fmt.Sprintf("module.%s.output.%s", v.Name, v.Field)
	case *config.ResourceVariable:
		return v.ResourceId()
	case *config.UserVariable:
		return fmt.Sprintf("var.%s", v.Name)
	default:
		return ""
	}
}
680893
func (fs *FlagSet) UintVar(p *uint, names []string, value uint, usage string) {
	fs.Var(newUintValue(value, p), names, usage)
}
1286022
func (b *stdBackend) SetVariable(id string, v int64) {
	if b.ssvFilter != nil && !b.ssvFilter(id) {
		return
	}
	b.ssvChangeC <- &stdSSVChange{id, true, v}
}
331826
func NewVarSet(vs ...Var) VarSet {
	s := VarSet{}
	for _, v := range vs {
		s.Add(v)
	}
	return s
}
1024229
func Var(inReal []float64, inTimePeriod int) []float64 {

	outReal := make([]float64, len(inReal))

	nbInitialElementNeeded := inTimePeriod - 1
	startIdx := nbInitialElementNeeded
	periodTotal1 := 0.0
	periodTotal2 := 0.0
	trailingIdx := startIdx - nbInitialElementNeeded
	i := trailingIdx
	if inTimePeriod > 1 {
		for i < startIdx {
			tempReal := inReal[i]
			periodTotal1 += tempReal
			tempReal *= tempReal
			periodTotal2 += tempReal
			i++
		}
	}
	outIdx := startIdx
	for ok := true; ok; {
		tempReal := inReal[i]
		periodTotal1 += tempReal
		tempReal *= tempReal
		periodTotal2 += tempReal
		meanValue1 := periodTotal1 / float64(inTimePeriod)
		meanValue2 := periodTotal2 / float64(inTimePeriod)
		tempReal = inReal[trailingIdx]
		periodTotal1 -= tempReal
		tempReal *= tempReal
		periodTotal2 -= tempReal
		outReal[outIdx] = meanValue2 - meanValue1*meanValue1
		i++
		trailingIdx++
		outIdx++
		ok = i < len(inReal)
	}
	return outReal
}
499211
func (f *FlagSet) Int(name string, value int, usage string) *int {
	p := new(int)
	f.IntVar(p, name, value, usage)
	return p
}
888911
func (g *Group) Var() *Statement {
	// notest
	s := Var()
	g.items = append(g.items, s)
	return s
}
1089045
func (b *buf) Varint() (c uint64, bits uint) {
	for i := 0; i < len(b.data); i++ {
		byte := b.data[i]
		c |= uint64(byte&0x7F) << bits
		bits += 7
		if byte&0x80 == 0 {
			b.off += dwarf.Offset(i + 1)
			b.data = b.data[i+1:]
			return c, bits
		}
	}
	return 0, 0
}
797967
func (head *Head) Vars() VarSet {
	vis := &VarVisitor{vars: VarSet{}}
	// TODO: improve test coverage for this.
	if head.Args != nil {
		Walk(vis, head.Args)
	}
	if head.Key != nil {
		Walk(vis, head.Key)
	}
	if head.Value != nil {
		Walk(vis, head.Value)
	}
	return vis.vars
}
830604
func SetVariable(id string, v int64) {
	monitor.RLock()
	defer monitor.RUnlock()
	monitor.backend().SetVariable(id, v)
}
452686
func (c *Configure) Int(name string, def int, description string) *int {
	i := new(int)
	c.IntVar(i, name, def, description)

	return i
}
60764
func storeVariableValueLength(dst []byte, offset, value ValueLength, reverse bool) {
	vpackAssert(value > 0)

	idx := offset
	if reverse {
		for value >= 0x80 {
			dst[idx] = byte(value | 0x80)
			idx--
			value >>= 7
		}
		dst[idx] = byte(value & 0x7f)
	} else {
		for value >= 0x80 {
			dst[idx] = byte(value | 0x80)
			idx++
			value >>= 7
		}
		dst[idx] = byte(value & 0x7f)
	}
}
664178
func readVariableValueLength(source []byte, offset ValueLength, reverse bool) ValueLength {
	length := ValueLength(0)
	p := uint(0)
	for {
		v := ValueLength(source[offset])
		length += (v & 0x7f) << p
		p += 7
		if reverse {
			offset--
		} else {
			offset++
		}
		if v&0x80 == 0 {
			break
		}
	}
	return length
}
499718
func (c *Distconf) Var() expvar.Var {
	return expvar.Func(func() interface{} {
		c.varsMutex.Lock()
		defer c.varsMutex.Unlock()

		m := make(map[string]interface{}, len(c.registeredVars))
		for name, v := range c.registeredVars {
			m[name] = v.distvar.GenericGet()
		}
		return m
	})
}
189574
func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) {
	f.Var(newUint64Value(value, p), name, usage)
}