// IsDefaultAnnotationText returns a pretty Yes/No String if
// the annotation is set
// TODO: remove Beta when no longer needed
190584
func IsDefaultAnnotationText(obj metav1.ObjectMeta) string {
	if obj.Annotations[IsDefaultStorageClassAnnotation] == "true" {
		return "Yes"
	}
	if obj.Annotations[BetaIsDefaultStorageClassAnnotation] == "true" {
		return "Yes"
	}

	return "No"
}
1219165
func (e Entry) StringDefault(def string) string {
	v := e.ValueRaw

	if vString, ok := v.(string); ok {
		return vString
	}

	return def
}
145033
func NewDefaultFromString(cur, size string, curDefault, sizeDefault int) Page {
	return New(number.DefaultInt(cur, curDefault), number.DefaultInt(size, sizeDefault))
}
1038079
func AnnotationFromLexTag(l Lexeme, t POSTag, f AnnotationFixer) *Annotation {
	a := &Annotation{
		Lexeme:         l,
		POSTag:         t,
		DependencyType: NoDepType,
		Lemma:          "",
		Lowered:        strings.ToLower(l.Value),
	}

	// it's ok to panic - it will cause the tests to fail
	if err := a.Process(f); err != nil {
		panic(err)
	}

	return a
}
437080
func (n *Namespace) CheckAndSetDefaults() error {
	if err := n.Metadata.CheckAndSetDefaults(); err != nil {
		return trace.Wrap(err)
	}
	isValid := IsValidNamespace(n.Metadata.Name)
	if !isValid {
		return trace.BadParameter("namespace %q is invalid", n.Metadata.Name)
	}

	return nil
}
429643
func (s *SigningImageFormat) SetDefaultFormat(v string) *SigningImageFormat {
	s.DefaultFormat = &v
	return s
}
598592
func (t EnumType) GetDefaultValue() interface{} {
	// manual default value has precedence over first value in list of allowed
	// values
	if t.DefaultValue != nil {
		return t.DefaultValue
	}
	// fallback to first permitted element
	if len(t.Values) > 0 {
		return t.Values[0]
	}
	return nil
}
88734
func WithDefaultTag(ref Named) Named {
	if IsNameOnly(ref) {
		ref, _ = WithTag(ref, DefaultTag)
	}
	return ref
}
1240419
func (term *Terminal) BasicDefault(prefix, def string) (string, error) {
	return term.Custom(prefix+" (Default: "+def+")", func(input string) (string, bool) {
		if input == "" {
			input = def
		}

		return input, true
	})
}
936508
func (c *Config) CheckAndSetDefaults() error {
	if c.Listener == nil {
		return trace.BadParameter("missing parameter Listener")
	}
	if c.Context == nil {
		c.Context = context.TODO()
	}
	if c.ReadDeadline == 0 {
		c.ReadDeadline = defaults.ReadHeadersTimeout
	}
	if c.Clock == nil {
		c.Clock = clockwork.NewRealClock()
	}
	return nil
}
1151638
func (s *Certificate) SetIsDefault(v bool) *Certificate {
	s.IsDefault = &v
	return s
}
489204
func (i *Identity) CheckAndSetDefaults() error {
	if i.Username == "" {
		return trace.BadParameter("missing identity username")
	}
	if len(i.Groups) == 0 {
		return trace.BadParameter("missing identity groups")
	}
	return nil
}
540668
func (win *Window) OptionText(text string, is_active bool) bool {
	style := &win.ctx.Style
	state, bounds, fitting := win.widget()
	if fitting != nil {
		fitting(toggleWidth(text, toggleOption, &style.Option, style.Font))
	}
	if !state {
		return false
	}
	in := win.inputMaybe(state)
	is_active = doToggle(win, bounds, is_active, text, toggleOption, &style.Option, in, style.Font)
	return is_active
}
192884
func checkAnnotations(pod *v1.Pod) bool {
	if podAnnotations := pod.GetAnnotations(); podAnnotations != nil {
		if podAnnotations[core.BootstrapCheckpointAnnotationKey] == "true" {
			return true
		}
	}
	return false
}
804946
func (u *UserV2) CheckAndSetDefaults() error {
	err := u.Metadata.CheckAndSetDefaults()
	if err != nil {
		return trace.Wrap(err)
	}

	err = u.Check()
	if err != nil {
		return trace.Wrap(err)
	}

	return nil
}
512761
func ArgDefault(args []string, n int, def string) string {
	if len(args) <= n {
		return def
	}
	return args[n]
}
921905
func (f *FlagSet) PrintDefaults() {
	f.VisitAll(func(flag *Flag) {
		s := ""
		if len(flag.Shorthand) > 0 {
			s = fmt.Sprintf("  -%s, --%s", flag.Shorthand, flag.Name)
		} else {
			s = fmt.Sprintf("  --%s", flag.Name)
		}

		name, usage := UnquoteUsage(flag)
		if len(name) > 0 {
			s += " " + name
		}

		s += "\n    \t"
		s += usage
		if !isZeroValue(flag.DefValue) {
			if _, ok := flag.Value.(*stringValue); ok {
				// put quotes on the value
				s += fmt.Sprintf(" (default %q)", flag.DefValue)
			} else {
				s += fmt.Sprintf(" (default %v)", flag.DefValue)
			}
		}
		fmt.Fprint(f.out(), s, "\n")
	})
}