// ValidatorListString returns a prettified validator list for logging purposes.
166889
func ValidatorListString(vals []*Validator) string {
	chunks := make([]string, len(vals))
	for i, val := range vals {
		chunks[i] = fmt.Sprintf("%s:%d", val.Address, val.VotingPower)
	}

	return strings.Join(chunks, ",")
}
231208
func fmtString(validAbbr map[string]string, validKeys []string) string {
	var sb strings.Builder
	i := 0
	for k, v := range validAbbr {
		sb.WriteString(fmt.Sprintf("%s(%s) ", v, k))
		i++
		if i != len(validAbbr) {
			sb.WriteString(",")
		}
	}
	if len(sb.String()) == 0 {
		for _, k := range validKeys {
			sb.WriteString(fmt.Sprintf("%s ", k))
		}
	}
	return sb.String()
}
600057
func ValidateParams(paramSpec []GeneratorParam, params map[string]interface{}) error {
	allErrs := []error{}
	for ix := range paramSpec {
		if paramSpec[ix].Required {
			value, found := params[paramSpec[ix].Name]
			if !found || IsZero(value) {
				allErrs = append(allErrs, fmt.Errorf("Parameter: %s is required", paramSpec[ix].Name))
			}
		}
	}
	return utilerrors.NewAggregate(allErrs)
}
978859
func ValidateMatchAll(patterns ...string) FieldValidatorFunc {
	prx := make([]*regexp.Regexp, len(patterns))

	for i, rxs := range patterns {
		prx[i] = regexp.MustCompile(rxs)
	}

	return func(value interface{}) error {
		for _, rx := range prx {
			if !rx.MatchString(typeutil.String(value)) {
				return fmt.Errorf("Value does not match pattern %q", rx.String())
			}
		}

		return nil
	}
}
552914
func (*GoFlags) StringList(o, d, c string) *[]*string {
	return &[]*string{flag.String(o, d, c)}
}
883480
func FormatStringList(list []string) (fields []interface{}) {
	fields = make([]interface{}, len(list))
	for i, v := range list {
		fields[i] = v
	}
	return
}
534611
func (t *PEP425Tag) TagString() string {
	return strings.Join([]string{t.Python, t.Abi, t.Platform}, "-")
}
1057149
func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
	return apimachineryvalidation.ValidateAnnotations(annotations, fldPath)
}
826311
func ValidateLabels(labels map[string]string, fldPath *validation.FieldPath) validation.ErrorList {
	allErrs := validation.ErrorList{}
	for k, v := range labels {
		allErrs = append(allErrs, ValidateLabelName(k, fldPath)...)
		if !validation.IsValidLabelValue(v) {
			allErrs = append(allErrs, validation.NewInvalidError(fldPath, v, labelValueErrorMsg))
		}
	}
	return allErrs
}
898971
func ListValues(v string) (spl []string) {
	if len(v) == 0 {
		return
	}
	lastWs := true
	wsr := func(r rune) bool {
		return (r == ' ') || (r == '\r') || (r == '\n') || (r == '\t')
	}
	wss := func(r string) bool {
		return (r == " ") || (r == "\r") || (r == "\n") || (r == "\t")
	}
	for wss(v[len(v)-1:]) {
		v = v[:len(v)-1]
	}
	for wss(v[:1]) {
		v = v[1:]
	}
	if len(v) > 0 {
		cur, num, i := "", 1, 0
		for _, r := range v {
			if wsr(r) {
				if !lastWs {
					num++
					lastWs = true
				}
			} else {
				lastWs = false
			}
		}
		lastWs, spl = true, make([]string, num)
		for _, r := range v {
			if wsr(r) {
				if !lastWs {
					if len(cur) > 0 {
						spl[i] = cur
						i++
					}
					cur, lastWs = "", true
				}
			} else {
				lastWs = false
				cur += string(r)
			}
		}
		if len(cur) > 0 {
			spl[i] = cur
		}
	}
	return
}
1346127
func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	var totalSize int64
	for k, v := range annotations {
		if !validation.IsQualifiedName(strings.ToLower(k)) {
			allErrs = append(allErrs, field.Invalid(fldPath, k, qualifiedNameErrorMsg))
		}
		totalSize += (int64)(len(k)) + (int64)(len(v))
	}
	if totalSize > (int64)(totalAnnotationSizeLimitB) {
		allErrs = append(allErrs, field.TooLong(fldPath, "", totalAnnotationSizeLimitB))
	}

	if annotations[api.AffinityAnnotationKey] != "" {
		allErrs = append(allErrs, ValidateAffinityInPodAnnotations(annotations, fldPath)...)
	}
	return allErrs
}
912862
func (c *Client) ListValues(prefix string) (keyval.BytesKeyValIterator, error) {
	keyValues := c.db.GetDataForPrefix(prefix)
	data := make([]*decoder.FileDataEntry, 0, len(keyValues))
	for _, entry := range keyValues {
		data = append(data, &decoder.FileDataEntry{
			Key:   entry.Key,
			Value: entry.Value,
		})
	}
	return &bytesKeyValIterator{len: len(data), data: data}, nil
}
689343
func decodeConfigStringList(lI []interface{}) (ret []string) {

	if len(lI) == 1 {
		return []string{lI[0].(string)}
	}
	ret = make([]string, len(lI))
	for i, vI := range lI {
		ret[i] = vI.(string)
	}
	return
}
283213
func validateTagList(tags []*api.Tag) error {
	if len(tags) == 0 {
		return status.Errorf(codes.InvalidArgument, "bad 'tags' - cannot be empty")
	}
	for _, t := range tags {
		kv := common.JoinInstanceTag(t)
		if err := common.ValidateInstanceTag(kv); err != nil {
			return status.Errorf(codes.InvalidArgument, "bad tag in 'tags' - %s", err)
		}
	}
	return nil
}
1191421
func ListAlgorithmProviders() string {
	var availableAlgorithmProviders []string
	for name := range algorithmProviderMap {
		availableAlgorithmProviders = append(availableAlgorithmProviders, name)
	}
	sort.Strings(availableAlgorithmProviders)
	return strings.Join(availableAlgorithmProviders, " | ")
}
924806
func PermFlagFromStringList(permissions []string) (PermFlag, error) {
	var permFlag PermFlag
	for _, perm := range permissions {
		s := strings.TrimSpace(perm)
		if s == "" {
			continue
		}
		flag, err := PermStringToFlag(s)
		if err != nil {
			return permFlag, err
		}
		permFlag |= flag
	}
	return permFlag, nil
}
727059
func ListToJSON(list []string) string {
	jsonValues_bytes, _ := json.Marshal(list)
	return string(jsonValues_bytes)
}