// compareThresholdValue returns true if the two thresholdValue objects are logically the same
771139
func compareThresholdValue(a evictionapi.ThresholdValue, b evictionapi.ThresholdValue) bool {
	if a.Quantity != nil {
		if b.Quantity == nil {
			return false
		}
		return a.Quantity.Cmp(*b.Quantity) == 0
	}
	if b.Quantity != nil {
		return false
	}
	return a.Percentage == b.Percentage
}
497753
func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	if assert.EqualValues(t, expected, actual, msgAndArgs...) {
		return
	}
	t.FailNow()
}
541985
func (v variableValue) compare(rhs variableValue) int {
	if v.I != nil {
		if rhs.I != nil {
			// Both integers.
			if *v.I < *rhs.I {
				return 1
			} else if *v.I > *rhs.I {
				return -1
			}
			return 0
		} else if rhs.S != nil {
			// int vs string
			return 1
		}
		// int vs Unbound.
		return -1
	} else if v.S != nil {
		if rhs.S != nil {
			// Both strings.
			if *v.S < *rhs.S {
				return 1
			} else if *v.S > *rhs.S {
				return -1
			}
			return 0
		}
		// string vs (int | unbound)
		return -1
	} else if rhs.isBound() {
		// unbound vs (int|string)
		return 1
	}
	// unbound vs unbound
	return 0
}
531731
func (s *HealthCheckCustomConfig) SetFailureThreshold(v int64) *HealthCheckCustomConfig {
	s.FailureThreshold = &v
	return s
}
179310
func (p Space) EqualValue(u convert.Equaler) bool {
	other, ok := u.(Space)
	if !ok {
		return false
	}
	p.Version = other.Version
	p.Lifecycle = other.Lifecycle
	return p.Equal(u)
}
695840
func (s *AbortCriteria) SetThresholdPercentage(v float64) *AbortCriteria {
	s.ThresholdPercentage = &v
	return s
}
708059
func GetDustThreshold(scriptSize int, relayFeePerKb btcutil.Amount) btcutil.Amount {
	// Calculate the total (estimated) cost to the network.  This is
	// calculated using the serialize size of the output plus the serial
	// size of a transaction input which redeems it.  The output is assumed
	// to be compressed P2PKH as this is the most common script type.  Use
	// the average size of a compressed P2PKH redeem input (148) rather than
	// the largest possible (txsizes.RedeemP2PKHInputSize).
	totalSize := 8 + wire.VarIntSerializeSize(uint64(scriptSize)) +
		scriptSize + 148

	byteFee := relayFeePerKb / 1000
	relayFee := btcutil.Amount(totalSize) * byteFee
	return 3 * relayFee
}
1269171
func (e Equalities) deepValueEqual(v1, v2 reflect.Value, visited map[visit]bool, depth int) bool {
	defer makeUsefulPanic(v1)

	if !v1.IsValid() || !v2.IsValid() {
		return v1.IsValid() == v2.IsValid()
	}
	if v1.Type() != v2.Type() {
		return false
	}
	if fv, ok := e[v1.Type()]; ok {
		return fv.Call([]reflect.Value{v1, v2})[0].Bool()
	}

	hard := func(k reflect.Kind) bool {
		switch k {
		case reflect.Array, reflect.Map, reflect.Slice, reflect.Struct:
			return true
		}
		return false
	}

	if v1.CanAddr() && v2.CanAddr() && hard(v1.Kind()) {
		addr1 := v1.UnsafeAddr()
		addr2 := v2.UnsafeAddr()
		if addr1 > addr2 {
			// Canonicalize order to reduce number of entries in visited.
			addr1, addr2 = addr2, addr1
		}

		// Short circuit if references are identical ...
		if addr1 == addr2 {
			return true
		}

		// ... or already seen
		typ := v1.Type()
		v := visit{addr1, addr2, typ}
		if visited[v] {
			return true
		}

		// Remember for later.
		visited[v] = true
	}

	switch v1.Kind() {
	case reflect.Array:
		// We don't need to check length here because length is part of
		// an array's type, which has already been filtered for.
		for i := 0; i < v1.Len(); i++ {
			if !e.deepValueEqual(v1.Index(i), v2.Index(i), visited, depth+1) {
				return false
			}
		}
		return true
	case reflect.Slice:
		if (v1.IsNil() || v1.Len() == 0) != (v2.IsNil() || v2.Len() == 0) {
			return false
		}
		if v1.IsNil() || v1.Len() == 0 {
			return true
		}
		if v1.Len() != v2.Len() {
			return false
		}
		if v1.Pointer() == v2.Pointer() {
			return true
		}
		for i := 0; i < v1.Len(); i++ {
			if !e.deepValueEqual(v1.Index(i), v2.Index(i), visited, depth+1) {
				return false
			}
		}
		return true
	case reflect.Interface:
		if v1.IsNil() || v2.IsNil() {
			return v1.IsNil() == v2.IsNil()
		}
		return e.deepValueEqual(v1.Elem(), v2.Elem(), visited, depth+1)
	case reflect.Ptr:
		return e.deepValueEqual(v1.Elem(), v2.Elem(), visited, depth+1)
	case reflect.Struct:
		for i, n := 0, v1.NumField(); i < n; i++ {
			if !e.deepValueEqual(v1.Field(i), v2.Field(i), visited, depth+1) {
				return false
			}
		}
		return true
	case reflect.Map:
		if (v1.IsNil() || v1.Len() == 0) != (v2.IsNil() || v2.Len() == 0) {
			return false
		}
		if v1.IsNil() || v1.Len() == 0 {
			return true
		}
		if v1.Len() != v2.Len() {
			return false
		}
		if v1.Pointer() == v2.Pointer() {
			return true
		}
		for _, k := range v1.MapKeys() {
			if !e.deepValueEqual(v1.MapIndex(k), v2.MapIndex(k), visited, depth+1) {
				return false
			}
		}
		return true
	case reflect.Func:
		if v1.IsNil() && v2.IsNil() {
			return true
		}
		// Can't do better than this:
		return false
	default:
		// Normal equality suffices
		if !v1.CanInterface() || !v2.CanInterface() {
			panic(unexportedTypePanic{})
		}
		return v1.Interface() == v2.Interface()
	}
}
1284556
func SetLogThreshold(level Level) {
	thresholdChanged := level != logThreshold
	if thresholdChanged {
		logThreshold = levelCheck(level)
		initialize()
	}
}
32069
func (f ContextInformation) EqualValue(u convert.Equaler) bool {
	return f.Equal(u)
}
1123311
func (s SpaceTemplate) EqualValue(u convert.Equaler) bool {
	other, ok := u.(SpaceTemplate)
	if !ok {
		return false
	}
	s.Version = other.Version
	s.Lifecycle = other.Lifecycle
	return s.Equal(u)
}
660682
func MaxValuesPerFacetEqual(o1, o2 *MaxValuesPerFacetOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
265127
func (t WorkItemLinkType) EqualValue(u convert.Equaler) bool {
	other, ok := u.(WorkItemLinkType)
	if !ok {
		return false
	}
	t.Version = other.Version
	t.Lifecycle = other.Lifecycle
	return t.Equal(u)
}
201250
func (s *CreateEndpointGroupInput) SetThresholdCount(v int64) *CreateEndpointGroupInput {
	s.ThresholdCount = &v
	return s
}
342896
func (s *AtomicString) CompareAndSwap(oldval, newval string) (swqpped bool) {
	s.mu.Lock()
	defer s.mu.Unlock()
	if s.str == oldval {
		s.str = newval
		return true
	}
	return false
}
676699
func (s *UpdateEndpointGroupInput) SetThresholdCount(v int64) *UpdateEndpointGroupInput {
	s.ThresholdCount = &v
	return s
}
151098
func (bk *Backend) CompareAndSwapVal(bucket []string, key string, val []byte, prevVal []byte, ttl time.Duration) error {
	// Open the bucket to work on the items.
	b, err := bk.openBucket(bk.flatten(bucket), os.O_CREATE|os.O_RDWR)
	if err != nil {
		er := trace.ConvertSystemError(err)
		if trace.IsNotFound(er) {
			return trace.CompareFailed("%v/%v did not match expected value", bucket, key)
		}
		return trace.Wrap(er)
	}
	defer b.Close()

	// Read in existing key. If it does not exist, is expired, or does not
	// match, return trace.CompareFailed.
	oldItem, ok := b.getItem(key)
	if !ok {
		return trace.CompareFailed("%v/%v did not match expected value", bucket, key)
	}
	if bk.isExpired(oldItem) {
		return trace.CompareFailed("%v/%v did not match expected value", bucket, key)
	}
	if bytes.Compare(oldItem.Value, prevVal) != 0 {
		return trace.CompareFailed("%v/%v did not match expected value", bucket, key)
	}

	// The compare was successful, update the item.
	b.updateItem(key, val, ttl)

	return nil
}