// RequiredUIs returns the required UIs.
505296
func (e *LoginProvisionedDevice) RequiredUIs() []libkb.UIKind {
	if e.SecretStoreOnly {
		return []libkb.UIKind{}
	}

	return []libkb.UIKind{
		libkb.LoginUIKind,
		libkb.SecretUIKind,
	}
}
1128238
func (m *clusterQuotaMapper) requireQuota(quota *quotav1.ClusterResourceQuota) bool {
	m.lock.RLock()
	selector, exists := m.requiredQuotaToSelector[quota.Name]
	m.lock.RUnlock()

	if selectorMatches(selector, exists, quota) {
		return false
	}

	m.lock.Lock()
	defer m.lock.Unlock()
	selector, exists = m.requiredQuotaToSelector[quota.Name]
	if selectorMatches(selector, exists, quota) {
		return false
	}

	m.requiredQuotaToSelector[quota.Name] = quota.Spec.Selector
	return true
}
801954
func (s *DropContinuousQueryStatement) RequiredPrivileges() (ExecutionPrivileges, error) {
	return ExecutionPrivileges{{Admin: false, Name: s.Database, Privilege: WritePrivilege}}, nil
}
383511
func (c *dataCopy) RequiredGas(input []byte) uint64 {
	return uint64(len(input)+31)/32*params.IdentityPerWordGas + params.IdentityBaseGas
}
201010
func RequiresAppInPing(requiresAppInPing bool) Option {
	return func(r *Ringpop) error {
		r.config.RequiresAppInPing = requiresAppInPing
		return nil
	}
}
583346
func (i *impl) Required(err error) bool {
	if i.retries == i.opts.Attempts {
		return false
	}

	s, ok := status.FromError(err)
	if ok && i.isRetryable(s.Group, s.Code) {
		time.Sleep(i.backoffPeriod())
		i.retries++
		return true
	}

	return false
}
1009986
func (d *Context) RequireUint(index int) uint {
	return uint(C.duk_require_uint(d.duk_context, C.duk_idx_t(index)))
}
1174522
func (d *Context) RequireContext(index int) *Context {
	return contextFromPointer(C.duk_require_context(d.duk_context, C.duk_idx_t(index)))
}
403612
func requiresPreAllocatedSELinuxLevel(constraint *securityapi.SecurityContextConstraints) bool {
	if constraint.SELinuxContext.Type != securityapi.SELinuxStrategyMustRunAs {
		return false
	}
	if constraint.SELinuxContext.SELinuxOptions == nil {
		return true
	}
	return constraint.SELinuxContext.SELinuxOptions.Level == ""
}
1360030
func (d *Context) RequireUndefined(index int) {
	C.duk_require_undefined(d.duk_context, C.duk_idx_t(index))
}
946089
func (s *ShowMeasurementCardinalityStatement) RequiredPrivileges() (ExecutionPrivileges, error) {
	if !s.Exact {
		return ExecutionPrivileges{{Admin: false, Name: s.Database, Privilege: ReadPrivilege}}, nil
	}
	return s.Sources.RequiredPrivileges()
}
660318
func (c *Conn) hideSetRequiredAcks(n int) error {
	switch n {
	case -1, 1:
		atomic.StoreInt32(&c.requiredAcks, int32(n))
		return nil
	default:
		return InvalidRequiredAcks
	}
}
216549
func (c *bigModExp) RequiredGas(input []byte) uint64 {
	var (
		baseLen = new(big.Int).SetBytes(getData(input, 0, 32))
		expLen  = new(big.Int).SetBytes(getData(input, 32, 32))
		modLen  = new(big.Int).SetBytes(getData(input, 64, 32))
	)
	if len(input) > 96 {
		input = input[96:]
	} else {
		input = input[:0]
	}
	// Retrieve the head 32 bytes of exp for the adjusted exponent length
	var expHead *big.Int
	if big.NewInt(int64(len(input))).Cmp(baseLen) <= 0 {
		expHead = new(big.Int)
	} else {
		if expLen.Cmp(big32) > 0 {
			expHead = new(big.Int).SetBytes(getData(input, baseLen.Uint64(), 32))
		} else {
			expHead = new(big.Int).SetBytes(getData(input, baseLen.Uint64(), expLen.Uint64()))
		}
	}
	// Calculate the adjusted exponent length
	var msb int
	if bitlen := expHead.BitLen(); bitlen > 0 {
		msb = bitlen - 1
	}
	adjExpLen := new(big.Int)
	if expLen.Cmp(big32) > 0 {
		adjExpLen.Sub(expLen, big32)
		adjExpLen.Mul(big8, adjExpLen)
	}
	adjExpLen.Add(adjExpLen, big.NewInt(int64(msb)))

	// Calculate the gas cost of the operation
	gas := new(big.Int).Set(math.BigMax(modLen, baseLen))
	switch {
	case gas.Cmp(big64) <= 0:
		gas.Mul(gas, gas)
	case gas.Cmp(big1024) <= 0:
		gas = new(big.Int).Add(
			new(big.Int).Div(new(big.Int).Mul(gas, gas), big4),
			new(big.Int).Sub(new(big.Int).Mul(big96, gas), big3072),
		)
	default:
		gas = new(big.Int).Add(
			new(big.Int).Div(new(big.Int).Mul(gas, gas), big16),
			new(big.Int).Sub(new(big.Int).Mul(big480, gas), big199680),
		)
	}
	gas.Mul(gas, math.BigMax(adjExpLen, big1))
	gas.Div(gas, new(big.Int).SetUint64(params.ModExpQuadCoeffDiv))

	if gas.BitLen() > 64 {
		return math.MaxUint64
	}
	return gas.Uint64()
}
829897
func (d *Context) RequirePointer(index int) unsafe.Pointer {
	return C.duk_require_pointer(d.duk_context, C.duk_idx_t(index))
}
421951
func (j *Job) ValidateRequirements() error {
	for key, _ := range j.requirements() {
		if !validRequirements.Contains(key) {
			return fmt.Errorf("unrecognized requirement in [X-Fleet] section: %q", key)
		}
	}
	return nil
}
1210737
func (s *permissionServiceImpl) RequireScope(ctx context.Context, identityID uuid.UUID, resourceID string, scopeName string) error {
	result, err := s.HasScope(ctx, identityID, resourceID, scopeName)
	if err != nil {
		return errors.NewInternalError(ctx, err)
	}

	if !result {
		return errors.NewForbiddenError(fmt.Sprintf("identity with ID %s does not have required scope %s for resource %s", identityID.String(), scopeName, resourceID))
	}

	return nil
}
146604
func (d *Context) RequireBoolean(index int) bool {
	return int(C.duk_require_boolean(d.duk_context, C.duk_idx_t(index))) == 1
}