// Precondition: y is nonzero.
188910
func (x Int) Mod(y Int) Int {
	var quo, rem big.Int
	quo.QuoRem(x.bigint, y.bigint, &rem)
	if (x.bigint.Sign() < 0) != (y.bigint.Sign() < 0) && rem.Sign() != 0 {
		rem.Add(&rem, y.bigint)
	}
	return Int{&rem}
}
914443
func (o *Object) Predicate() (*predicate.Predicate, error) {
	if o.p == nil {
		return nil, fmt.Errorf("triple.Literal does not box a predicate in %s", o)
	}
	return o.p, nil
}
990807
func Convert_v1_Preconditions_To_core_Preconditions(in *v1.Preconditions, out *core.Preconditions, s conversion.Scope) error {
	return autoConvert_v1_Preconditions_To_core_Preconditions(in, out, s)
}
690024
func (*Namespace) Eq(x, y interface{}) bool {
	if e, ok := x.(compare.Eqer); ok {
		return e.Eq(y)
	}

	if e, ok := y.(compare.Eqer); ok {
		return e.Eq(x)
	}

	normalize := func(v interface{}) interface{} {
		if types.IsNil(v) {
			return nil
		}
		vv := reflect.ValueOf(v)
		switch vv.Kind() {
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			return vv.Int()
		case reflect.Float32, reflect.Float64:
			return vv.Float()
		case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
			return vv.Uint()
		default:
			return v
		}
	}
	x = normalize(x)
	y = normalize(y)
	return reflect.DeepEqual(x, y)
}
624097
func composeConditionWithBinaryOp(ctx sessionctx.Context, conditions []Expression, funcName string) Expression {
	length := len(conditions)
	if length == 0 {
		return nil
	}
	if length == 1 {
		return conditions[0]
	}
	expr := NewFunctionInternal(ctx, funcName,
		types.NewFieldType(mysql.TypeTiny),
		composeConditionWithBinaryOp(ctx, conditions[:length/2], funcName),
		composeConditionWithBinaryOp(ctx, conditions[length/2:], funcName))
	return expr
}
78166
func (c Client) Cos(x, y Expr) (float32, error) {
	req := cosQuery{A: x, B: y}
	body, err := c.fetch(req, "cos")
	if err != nil {
		return 0.0, err
	}

	var data cosResponse
	err = json.Unmarshal(body, &data)
	if err != nil {
		return 0.0, fmt.Errorf("error unmarshalling result: %v", err)
	}

	return data.Value, nil
}
797916
func NewUIDPreconditions(uid string) *Preconditions {
	u := types.UID(uid)
	return &Preconditions{UID: &u}
}
1308314
func (crng CauchyGenerator) Cauchy(x0, gamma float64) float64 {
	if !(gamma > 0.0) {
		panic(fmt.Sprintf("Invalid parameter gamma: %.2f", gamma))
	}
	return crng.cauchy(x0, gamma)
}
324554
func processCondition(c condition, varsAndValues variablesValuesSet) (*processedCondition, error) {
	goCond, err := pythonToGoCondition(c.Condition)
	if err != nil {
		return nil, err
	}
	out := &processedCondition{condition: c.Condition, variables: c.Variables}
	if out.expr, err = parser.ParseExpr(goCond); err != nil {
		return nil, err
	}
	if out.equalityValues, err = processConditionAst(out.expr, varsAndValues); err != nil {
		return nil, err
	}
	return out, out.variables.verify()
}
181319
func ceilLogBaseTwo(x uint64) uint64 {
	y := uint64(1)
	if (x & (x - 1)) == 0 {
		y = 0
	}
	j := uint64(32)
	i := uint64(0)

	for ; i < 6; i++ {
		k := j
		if (x & log2lookup[i]) == 0 {
			k = 0
		}
		y += k
		x >>= k
		j >>= 1
	}

	return y
}
350486
func validateSpartaPreconditions(lambdaAWSInfos []*LambdaAWSInfo,
	logger *logrus.Logger) error {

	var errorText []string
	collisionMemo := make(map[string]int)

	incrementCounter := func(keyName string) {
		_, exists := collisionMemo[keyName]
		if !exists {
			collisionMemo[keyName] = 1
		} else {
			collisionMemo[keyName] = collisionMemo[keyName] + 1
		}
	}
	// 0 - check for invalid signatures
	for _, eachLambda := range lambdaAWSInfos {
		validationErr := ensureValidSignature(eachLambda.userSuppliedFunctionName,
			eachLambda.handlerSymbol)
		if validationErr != nil {
			errorText = append(errorText, validationErr.Error())
		}
	}

	// 1 - check for duplicate golang function references.
	for _, eachLambda := range lambdaAWSInfos {
		incrementCounter(eachLambda.lambdaFunctionName())
		for _, eachCustom := range eachLambda.customResources {
			incrementCounter(eachCustom.userFunctionName)
		}
	}
	// Duplicates?
	for eachLambdaName, eachCount := range collisionMemo {
		if eachCount > 1 {
			logger.WithFields(logrus.Fields{
				"CollisionCount": eachCount,
				"Name":           eachLambdaName,
			}).Error("NewAWSLambda")
			errorText = append(errorText,
				fmt.Sprintf("Multiple definitions of lambda: %s", eachLambdaName))
		}
	}
	logger.WithFields(logrus.Fields{
		"CollisionMap": collisionMemo,
	}).Debug("Lambda collision map")

	if len(errorText) != 0 {
		return errors.New(strings.Join(errorText[:], "\n"))
	}
	// Check that the sysinfo package is installed. This
	// may not be installed on OSX, since it's excluded
	// via a build tag
	goPath := system.GoPath()

	// Check that the file exists
	sysinfoPath := filepath.Join(goPath, "src",
		"github.com",
		"zcalusic",
		"sysinfo",
		"sysinfo.go")
	logger.WithFields(logrus.Fields{
		"sysinfoPath": sysinfoPath,
	}).Debug("Checking installation status of github.com/zcalusic/sysinfo")
	_, sysinfoErr := os.Stat(sysinfoPath)
	if os.IsNotExist(sysinfoErr) {
		// Let's make sure it's really not there.
		// In case `gvm` is managing paths
		sysinfoErr = buildSysInfoSample(logger)
		if sysinfoErr != nil {
			logger.WithFields(logrus.Fields{
				"sysinfoMarkerPath": sysinfoPath,
				"os":                runtime.GOOS,
				"gopath":            goPath,
			}).Error("The `github.com/zcalusic/sysinfo` package is not installed")
			return errors.New("Please run `go get -u -v github.com/zcalusic/sysinfo` to install this Linux-only package. This package is used when cross-compiling your AWS Lambda binary and cannot be reliably imported across platforms. When you `go get` the package, you may see errors as in `undefined: syscall.Utsname`. These are expected and can be ignored")
		}
	}
	return nil
}
1034063
func validEqualCond(cond Expression) (*Column, *Constant) {
	if eq, ok := cond.(*ScalarFunction); ok {
		if eq.FuncName.L != ast.EQ {
			return nil, nil
		}
		if col, colOk := eq.GetArgs()[0].(*Column); colOk {
			if con, conOk := eq.GetArgs()[1].(*Constant); conOk {
				return col, con
			}
		}
		if col, colOk := eq.GetArgs()[1].(*Column); colOk {
			if con, conOk := eq.GetArgs()[0].(*Constant); conOk {
				return col, con
			}
		}
	}
	return nil, nil
}
1119093
func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool {
	result := comp()
	if !result {
		Fail(t, "Condition failed!", msgAndArgs...)
	}
	return result
}
331280
func (a *expr) genConstant(v Value) {
	switch a.t.lit().(type) {
	case *boolType:
		a.eval = func(t *Thread) bool { return v.(BoolValue).Get(t) }
	case *uintType:
		a.eval = func(t *Thread) uint64 { return v.(UintValue).Get(t) }
	case *intType:
		a.eval = func(t *Thread) int64 { return v.(IntValue).Get(t) }
	case *idealIntType:
		val := v.(IdealIntValue).Get()
		a.eval = func() *big.Int { return val }
	case *floatType:
		a.eval = func(t *Thread) float64 { return v.(FloatValue).Get(t) }
	case *idealFloatType:
		val := v.(IdealFloatValue).Get()
		a.eval = func() *big.Rat { return val }
	case *stringType:
		a.eval = func(t *Thread) string { return v.(StringValue).Get(t) }
	case *ArrayType:
		a.eval = func(t *Thread) ArrayValue { return v.(ArrayValue).Get(t) }
	case *StructType:
		a.eval = func(t *Thread) StructValue { return v.(StructValue).Get(t) }
	case *PtrType:
		a.eval = func(t *Thread) Value { return v.(PtrValue).Get(t) }
	case *FuncType:
		a.eval = func(t *Thread) Func { return v.(FuncValue).Get(t) }
	case *SliceType:
		a.eval = func(t *Thread) Slice { return v.(SliceValue).Get(t) }
	case *MapType:
		a.eval = func(t *Thread) Map { return v.(MapValue).Get(t) }
	default:
		log.Panicf("unexpected constant type %v at %v", a.t, a.pos)
	}
}
553366
func Yn(n int, x float32) float32 {
	return engomath.Yn(n, x)
}
752117
func (nc *NumberConstraint) ExclusiveMinimum(b bool) *NumberConstraint {
	nc.exclusiveMinimum = b
	return nc
}
1123179
func (p *ProtoCommand) PostCondition(state State, result Result) *gopter.PropResult {
	if p.PostConditionFunc != nil {
		return p.PostConditionFunc(state, result)
	}
	return &gopter.PropResult{Status: gopter.PropTrue}
}