// validateValues reads the values provided as args and validates that they are
// valid UTF-8.
976327
func (c *configCommand) validateValues(ctx *cmd.Context) (map[string]string, error) {
	settings := map[string]string{}
	for k, v := range c.values {
		//empty string is also valid as a setting value
		if v == "" {
			settings[k] = v
			continue
		}

		if v[0] != '@' {
			if !utf8.ValidString(v) {
				return nil, errors.Errorf("value for option %q contains non-UTF-8 sequences", k)
			}
			settings[k] = v
			continue
		}
		nv, err := readValue(ctx, v[1:])
		if err != nil {
			return nil, errors.Trace(err)
		}
		if !utf8.ValidString(nv) {
			return nil, errors.Errorf("value for option %q contains non-UTF-8 sequences", k)
		}
		settings[k] = nv
	}
	return settings, nil
}
43102
func validateArgumentsValues(prefix string, arguments wfv1.Arguments) error {
	for _, param := range arguments.Parameters {
		if param.Value == nil {
			return errors.Errorf(errors.CodeBadRequest, "%s%s.value is required", prefix, param.Name)
		}
	}
	for _, art := range arguments.Artifacts {
		if art.From == "" && !art.HasLocation() {
			return errors.Errorf(errors.CodeBadRequest, "%s%s.from or artifact location is required", prefix, art.Name)
		}
	}
	return nil
}
1159959
func (s *PartitionInput) SetValues(v []*string) *PartitionInput {
	s.Values = v
	return s
}
1011063
func (s *SetDimension) SetValues(v []*string) *SetDimension {
	s.Values = v
	return s
}
480412
func Valid(arg string) bool {
	_, err := Parse(arg)
	return err == nil
}
617111
func (s *ParameterStringFilter) SetValues(v []*string) *ParameterStringFilter {
	s.Values = v
	return s
}
170173
func (s *GroupFilter) SetValues(v []*string) *GroupFilter {
	s.Values = v
	return s
}
1185675
func (k *Key) ValidInts(delim string) []int {
	vals, _ := k.parseInts(k.Strings(delim), false, false)
	return vals
}
1286933
func (s *ServiceFilter) SetValues(v []*string) *ServiceFilter {
	s.Values = v
	return s
}
979399
func (s *PathPatternConditionConfig) SetValues(v []*string) *PathPatternConditionConfig {
	s.Values = v
	return s
}
997983
func reflectValues(valueType string, value interface{}) (reflect.Value, error) {
	theType, ok := typesMap[valueType]
	if !ok {
		return reflect.Value{}, NewErrUnsupportedType(valueType)
	}

	// For NULL we return an empty slice
	if value == nil {
		return reflect.MakeSlice(theType, 0, 0), nil
	}

	var theValue reflect.Value

	// Booleans
	if theType.String() == "[]bool" {
		bools := reflect.ValueOf(value)

		theValue = reflect.MakeSlice(theType, bools.Len(), bools.Len())
		for i := 0; i < bools.Len(); i++ {
			boolValue, err := getBoolValue(strings.Split(theType.String(), "[]")[1], bools.Index(i).Interface())
			if err != nil {
				return reflect.Value{}, err
			}

			theValue.Index(i).SetBool(boolValue)
		}

		return theValue, nil
	}

	// Integers
	if strings.HasPrefix(theType.String(), "[]int") {
		ints := reflect.ValueOf(value)

		theValue = reflect.MakeSlice(theType, ints.Len(), ints.Len())
		for i := 0; i < ints.Len(); i++ {
			intValue, err := getIntValue(strings.Split(theType.String(), "[]")[1], ints.Index(i).Interface())
			if err != nil {
				return reflect.Value{}, err
			}

			theValue.Index(i).SetInt(intValue)
		}

		return theValue, nil
	}

	// Unsigned integers
	if strings.HasPrefix(theType.String(), "[]uint") {
		uints := reflect.ValueOf(value)

		theValue = reflect.MakeSlice(theType, uints.Len(), uints.Len())
		for i := 0; i < uints.Len(); i++ {
			uintValue, err := getUintValue(strings.Split(theType.String(), "[]")[1], uints.Index(i).Interface())
			if err != nil {
				return reflect.Value{}, err
			}

			theValue.Index(i).SetUint(uintValue)
		}

		return theValue, nil
	}

	// Floating point numbers
	if strings.HasPrefix(theType.String(), "[]float") {
		floats := reflect.ValueOf(value)

		theValue = reflect.MakeSlice(theType, floats.Len(), floats.Len())
		for i := 0; i < floats.Len(); i++ {
			floatValue, err := getFloatValue(strings.Split(theType.String(), "[]")[1], floats.Index(i).Interface())
			if err != nil {
				return reflect.Value{}, err
			}

			theValue.Index(i).SetFloat(floatValue)
		}

		return theValue, nil
	}

	// Strings
	if theType.String() == "[]string" {
		strs := reflect.ValueOf(value)

		theValue = reflect.MakeSlice(theType, strs.Len(), strs.Len())
		for i := 0; i < strs.Len(); i++ {
			strValue, err := getStringValue(strings.Split(theType.String(), "[]")[1], strs.Index(i).Interface())
			if err != nil {
				return reflect.Value{}, err
			}

			theValue.Index(i).SetString(strValue)
		}

		return theValue, nil
	}

	return reflect.Value{}, NewErrUnsupportedType(valueType)
}
142757
func (m *RegexpMap) LookupValues(lookupKey string) (lookupValues []string) {
	for reStr, rule := range m.rules {

		if !rule.MatchString(lookupKey) {
			continue
		}
		val, exists := m.rulesRelation[reStr]
		if exists {
			lookupValues = append(lookupValues, val.Keys()...)
		}
	}
	return keepUniqueStrings(lookupValues)
}
1270685
func (p *Params) calcValues() url.Values {
	numParams := len(p.Query) + len(p.Fixed) + len(p.Route) + len(p.Form)

	// If there were no params, return an empty map.
	if numParams == 0 {
		return make(url.Values, 0)
	}

	// If only one of the param sources has anything, return that directly.
	switch numParams {
	case len(p.Query):
		return p.Query
	case len(p.Route):
		return p.Route
	case len(p.Fixed):
		return p.Fixed
	case len(p.Form):
		return p.Form
	}

	// Copy everything into a param map,
	// order of priority is least to most trusted
	values := make(url.Values, numParams)

	// ?query string parameters are first
	for k, v := range p.Query {
		values[k] = append(values[k], v...)
	}

	// form parameters append
	for k, v := range p.Form {
		values[k] = append(values[k], v...)
	}

	// :/path parameters overwrite
	for k, v := range p.Route {
		values[k] = v
	}

	// fixed route parameters overwrite
	for k, v := range p.Fixed {
		values[k] = v
	}

	return values
}
1189031
func (val AnnotationValue) Validate(_ interface{}) error {
	if annotationValueRegex.Match([]byte(val)) {
		return nil
	}

	return errInvalidAnnotationValue
}
520639
func Values(values cty.Value) (cty.Value, error) {
	return ValuesFunc.Call([]cty.Value{values})
}
1284917
func ValidTrytes(trytes Trytes) error {
	if !trytesRegex.MatchString(string(trytes)) {
		return ErrInvalidTrytes
	}
	return nil
}
389051
func (r *Request) QueryValues() url.Values {
	if r.Values == nil {
		if r.Request != nil {
			r.Values = r.Request.URL.Query()
		} else {
			r.Values = url.Values{}
		}
	}
	return r.Values
}