// WithCrossValidationSet creates a trainer with a cross validation set
434988
func WithCrossValidationSet(st []treebank.SentenceTag) TrainerConsOpt {
	f := func(t *Trainer) {
		t.crossValSet = st
	}
	return f
}
51963
func LSetWithFlags(path, name string, data []byte, flags int) error {
	if err := lsetxattr(path, name, data, flags); err != nil {
		return &Error{"xattr.LSetWithFlags", path, name, err}
	}
	return nil
}
1309170
func (r Route) ValidateWithRandomPort(randomPort bool) error {
	if r.Domain.IsHTTP() && randomPort {
		return actionerror.InvalidHTTPRouteSettings{Domain: r.Domain.Name}
	}

	if r.Domain.IsTCP() && !r.Port.IsSet && !randomPort {
		return actionerror.TCPRouteOptionsNotProvidedError{}
	}
	return r.Validate()
}
980939
func WithTLS(cfg *tls.Config) Option {
	return func(opts *options) {
		opts.useTLS = true
		opts.tlsConfig = cfg
	}
}
369962
func (c *Config) WithDisableParamValidation(disable bool) *Config {
	c.DisableParamValidation = &disable
	return c
}
340542
func (e *Element) setInvalidated(invalid bool) {
	e.lock.Lock()
	e.invalidated = invalid
	e.lock.Unlock()
}
578182
func SelectorFromValidatedSet(ls Set) Selector {
	if ls == nil || len(ls) == 0 {
		return internalSelector{}
	}
	var requirements internalSelector
	for label, value := range ls {
		requirements = append(requirements, Requirement{key: label, operator: selection.Equals, strValues: []string{value}})
	}
	// sort to have deterministic string representation
	sort.Sort(ByKey(requirements))
	return requirements
}
509937
func (me *TxsdPlatformTypeChoiceCapillarySequenceInstrumentModel) Set(s string) {
	(*xsdt.String)(me).Set(s)
}
753408
func (s *mustMatchPatterns) Validate(pod *api.Pod) field.ErrorList {
	allErrs := field.ErrorList{}

	var sysctls []api.Sysctl
	if pod.Spec.SecurityContext != nil {
		sysctls = pod.Spec.SecurityContext.Sysctls
	}

	fieldPath := field.NewPath("pod", "spec", "securityContext").Child("sysctls")

	for i, sysctl := range sysctls {
		switch {
		case s.isForbidden(sysctl.Name):
			allErrs = append(allErrs, field.ErrorList{field.Forbidden(fieldPath.Index(i), fmt.Sprintf("sysctl %q is not allowed", sysctl.Name))}...)
		case s.isSafe(sysctl.Name):
			continue
		case s.isAllowedUnsafe(sysctl.Name):
			continue
		default:
			allErrs = append(allErrs, field.ErrorList{field.Forbidden(fieldPath.Index(i), fmt.Sprintf("unsafe sysctl %q is not allowed", sysctl.Name))}...)
		}
	}

	return allErrs
}
214094
func (templateStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	return validation.ValidateTemplate(obj.(*templateapi.Template))
}
65813
func (s *CreateXssMatchSetOutput) SetXssMatchSet(v *XssMatchSet) *CreateXssMatchSetOutput {
	s.XssMatchSet = v
	return s
}
667384
func (c *ControllerAPI) ConfigSet(args params.ControllerConfigSet) error {
	if err := c.checkHasAdmin(); err != nil {
		return errors.Trace(err)
	}
	if err := c.state.UpdateControllerConfig(args.Config, nil); err != nil {
		return errors.Trace(err)
	}
	// TODO(thumper): add a version to controller config to allow for
	// simultaneous updates and races in publishing, potentially across
	// HA servers.
	cfg, err := c.state.ControllerConfig()
	if err != nil {
		return errors.Trace(err)
	}
	if _, err := c.hub.Publish(
		controller.ConfigChanged,
		controller.ConfigChangedMessage{cfg}); err != nil {
		return errors.Trace(err)
	}
	return nil
}
27479
func WithTemplates(b *Bundle) router.Middleware {
	return func(c *router.Context, next router.Handler) {
		// Note: Use(...) calls EnsureLoaded and initializes b.err inside.
		c.Context = Use(c.Context, b, &Extra{
			Request: c.Request,
			Params:  c.Params,
		})
		if b.err != nil {
			http.Error(c.Writer, fmt.Sprintf("Can't load HTML templates.\n%s", b.err), http.StatusInternalServerError)
			return
		}
		next(c)
	}
}
1193487
func (vs *Set) IterateValidators(iter func(id crypto.Addressable, power *big.Int) error) error {
	if vs == nil {
		return nil
	}
	addresses := make(crypto.Addresses, 0, len(vs.powers))
	for address := range vs.powers {
		addresses = append(addresses, address)
	}
	sort.Sort(addresses)
	for _, address := range addresses {
		err := iter(vs.publicKeys[address], new(big.Int).Set(vs.powers[address]))
		if err != nil {
			return err
		}
	}
	return nil
}
1178386
func WithConfig(conf NNConfig) TrainerConsOpt {
	f := func(t *Trainer) {
		t.nn.NNConfig = conf
		t.nn.dict = t.corpus
		t.nn.transitions = t.ts
		t.EvalPerIter = conf.EvalPerIteration
	}
	return f
}
1277653
func (o *DeleteJSONWebKeyParams) WithSet(set string) *DeleteJSONWebKeyParams {
	o.SetSet(set)
	return o
}
550779
func (s *GetXssMatchSetOutput) SetXssMatchSet(v *XssMatchSet) *GetXssMatchSetOutput {
	s.XssMatchSet = v
	return s
}