// Absdif returns the absolute value of the difference of two inputs.
486553
func (ins Inputs) Absdif(val Input) Input {
	ia := make([]Input, len(ins))
	for i, in := range ins {
		ia[i] = in.Absdif(val)
	}
	return Inputs(ia)
}
1239552
func (c *Client) GetDiff(i *GetDiffInput) (*Diff, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.From == 0 {
		return nil, ErrMissingFrom
	}

	if i.To == 0 {
		return nil, ErrMissingTo
	}

	path := fmt.Sprintf("service/%s/diff/from/%d/to/%d", i.Service, i.From, i.To)
	resp, err := c.Get(path, nil)
	if err != nil {
		return nil, err
	}

	var d *Diff
	if err := decodeJSON(&d, resp.Body); err != nil {
		return nil, err
	}
	return d, nil
}
398613
func Abs(os, path, cwd string) (_ string, err error) {
	if IsAbs(os, path) {
		return Clean(os, path), nil
	}
	return Clean(os, Join(os, cwd, path)), nil
}
605766
func getDiff(a, b map[string]interface{}) (map[string]interface{}, error) {
	into := map[string]interface{}{}
	for key, bv := range b {
		av, ok := a[key]
		// value was added
		if !ok {
			into[key] = bv
			continue
		}
		// If types have changed, replace completely
		if reflect.TypeOf(av) != reflect.TypeOf(bv) {
			into[key] = bv
			continue
		}
		// Types are the same, compare values
		switch at := av.(type) {
		case map[string]interface{}:
			bt := bv.(map[string]interface{})
			dst := make(map[string]interface{}, len(bt))
			dst, err := getDiff(at, bt)
			if err != nil {
				return nil, err
			}
			if len(dst) > 0 {
				into[key] = dst
			}
		case string, float64, bool:
			if !matchesValue(av, bv) {
				into[key] = bv
			}
		case []interface{}:
			bt := bv.([]interface{})
			if !matchesArray(at, bt) {
				into[key] = bv
			}
		case nil:
			switch bv.(type) {
			case nil:
				// Both nil, fine.
			default:
				into[key] = bv
			}
		default:
			panic(fmt.Sprintf("Unknown type:%T in key %s", av, key))
		}
	}
	// Now add all deleted values as nil
	for key := range a {
		_, found := b[key]
		if !found {
			into[key] = nil
		}
	}
	return into, nil
}
393335
func (bb BoundingBox) Antimeridian() bool {
	if bb.Valid() == nil {
		switch len(bb) {
		case 4:
			if bb[0] > bb[2] {
				return true
			}
		case 6:
			if bb[0] > bb[3] {
				return true
			}
		}
	}
	return false
}
219041
func (v OutputValue) Absolute(m ModuleInstance) AbsOutputValue {
	return AbsOutputValue{
		Module:      m,
		OutputValue: v,
	}
}
1178750
func (p *Package) Abs() string {
	elem := "src" // GOPATH mode.
	if p.Workspace.isModuleMode {
		elem = "" // Module mode.
	}
	return filepath.Join(p.Workspace.Path, elem, p.Path)
}
1261168
func ApplyDiff(base cty.Value, d *terraform.InstanceDiff, schema *configschema.Block) (cty.Value, error) {
	return d.ApplyToValue(base, schema)
}
332923
func (m Mat4x3) Abs() Mat4x3 {
	return Mat4x3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11])}
}
486533
func (b *PCMBuffer) calculateIntBitDepth() uint8 {
	if b == nil {
		return 0
	}
	bitDepth := b.SourceBitDepth
	if bitDepth != 0 {
		return bitDepth
	}
	var max int64
	switch b.DataType {
	case DataTypeI8:
		var i8max int8
		for _, s := range b.I8 {
			if s > i8max {
				i8max = s
			}
		}
		max = int64(i8max)
	case DataTypeI16:
		var i16max int16
		for _, s := range b.I16 {
			if s > i16max {
				i16max = s
			}
		}
		max = int64(i16max)
	case DataTypeI32:
		var i32max int32
		for _, s := range b.I32 {
			if s > i32max {
				i32max = s
			}
		}
		max = int64(i32max)
	default:
		// This method is only meant to be used on int buffers.
		return bitDepth
	}
	bitDepth = 8
	if max > 127 {
		bitDepth = 16
	}
	// greater than int16, expecting int24
	if max > 32767 {
		bitDepth = 24
	}
	// int 32
	if max > 8388607 {
		bitDepth = 32
	}
	// int 64
	if max > 4294967295 {
		bitDepth = 64
	}

	return bitDepth
}
567721
func (ins Inputs) Moddif(y, mod Input) Input {
	im := make([]Input, len(ins))
	for i, in := range ins {
		im[i] = in.Moddif(y, mod)
	}
	return Inputs(im)
}
1024748
func (c *StatsdClient) Absolute(stat string, value int64) error {
	return c.send(stat, "%d|a", value, 1)
}
334716
func binOpAbsdif(rate int8, x, y Input, numOutputs int) Input {
	CheckRate(rate)
	return NewInput(BinOpUgenName, rate, BinOpAbsdif, numOutputs, x, y)
}
191347
func Abs(x int64) uint64 {
	m := x >> 63
	return uint64((x ^ m) - m)
}
235331
func DiffLine(a, b string) *DiffSolution {
	aw := splitLine(a)
	bw := splitLine(b)
	if len(aw)*len(bw) > 100000000 {
		return nil
	}
	return NewSequenceDiffer(aw, bw).Solve()
}
448706
func moddif(rate int8, x, y, mod Input, numOutputs int) Input {
	CheckRate(rate)

	if x == nil {
		panic("Moddif expects the first argument to not be nil")
	}
	if y == nil {
		y = C(0)
	}
	if mod == nil {
		mod = C(1)
	}
	return NewInput("ModDif", rate, 0, numOutputs, x, y, mod)
}
1318711
func (u *Ugen) Moddif(y, mod Input) Input {
	return moddif(u.Rate, u, y, mod, u.NumOutputs)
}