// SetArgs sets the Args field's value.
977389
func (s *ScriptBootstrapActionConfig) SetArgs(v []*string) *ScriptBootstrapActionConfig {
	s.Args = v
	return s
}
589757
func (c *Context) Args() Args {
	args := Args(c.flagSet.Args())
	return args
}
907896
func (c *configCommand) handleArgs(args []string) error {
	// This must be setting values but let's make sure.
	var pairs, numArgs int
	numArgs = len(args)
	for _, a := range args {
		if strings.Contains(a, "=") {
			pairs++
		}
	}
	if pairs == numArgs {
		return c.parseSet(args)
	}
	if pairs == 0 {
		return errors.New("can only retrieve a single value, or all values")
	}
	return errors.New("cannot set and retrieve values simultaneously")
}
471836
func (p *EnumParam) Args() []string {
	if p.value == nil {
		return []string{}
	}
	return []string{fmt.Sprintf("--%v", p.CLIName()), *p.value}
}
574922
func (s *DevEndpoint) SetArguments(v map[string]*string) *DevEndpoint {
	s.Arguments = v
	return s
}
489909
func (s *UpdateTaskInput) SetOptions(v *Options) *UpdateTaskInput {
	s.Options = v
	return s
}
226691
func (p *BoolParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}
677886
func (s *LogConfiguration) SetOptions(v map[string]*string) *LogConfiguration {
	s.Options = v
	return s
}
412243
func (r *PropResult) WithArgs(args []*PropArg) *PropResult {
	r.Args = args
	return r
}
691189
func (j *Job) setArg(key string, val interface{}) {
	if j.Args == nil {
		j.Args = make(map[string]interface{})
	}
	j.Args[key] = val
}
54465
func (s *OptionGroup) SetOptions(v []*Option) *OptionGroup {
	s.Options = v
	return s
}
1205226
func (s *Update) SetParams(v []*UpdateParam) *Update {
	s.Params = v
	return s
}
9040
func (a *EnableArgs) SetPatterns(patterns []RequestPattern) *EnableArgs {
	a.Patterns = patterns
	return a
}
1094148
func (s *DescribeCommandsOutput) SetCommands(v []*Command) *DescribeCommandsOutput {
	s.Commands = v
	return s
}
764854
func (s *UpdateDevEndpointInput) SetAddArguments(v map[string]*string) *UpdateDevEndpointInput {
	s.AddArguments = v
	return s
}
524316
func (s *ElasticsearchClusterConfigStatus) SetOptions(v *ElasticsearchClusterConfig) *ElasticsearchClusterConfigStatus {
	s.Options = v
	return s
}
1240629
func setArgs(locals []Value, fn *Function, args Tuple, kwargs []Tuple) error {
	cond := func(x bool, y, z interface{}) interface{} {
		if x {
			return y
		}
		return z
	}

	// nparams is the number of ordinary parameters (sans * or **).
	nparams := fn.NumParams()
	if fn.HasVarargs() {
		nparams--
	}
	if fn.HasKwargs() {
		nparams--
	}

	// This is the algorithm from PyEval_EvalCodeEx.
	var kwdict *Dict
	n := len(args)
	if nparams > 0 || fn.HasVarargs() || fn.HasKwargs() {
		if fn.HasKwargs() {
			kwdict = new(Dict)
			locals[fn.NumParams()-1] = kwdict
		}

		// too many args?
		if len(args) > nparams {
			if !fn.HasVarargs() {
				return fmt.Errorf("function %s takes %s %d argument%s (%d given)",
					fn.Name(),
					cond(len(fn.defaults) > 0, "at most", "exactly"),
					nparams,
					cond(nparams == 1, "", "s"),
					len(args)+len(kwargs))
			}
			n = nparams
		}

		// set of defined (regular) parameters
		var defined intset
		defined.init(nparams)

		// ordinary parameters
		for i := 0; i < n; i++ {
			locals[i] = args[i]
			defined.set(i)
		}

		// variadic arguments
		if fn.HasVarargs() {
			tuple := make(Tuple, len(args)-n)
			for i := n; i < len(args); i++ {
				tuple[i-n] = args[i]
			}
			locals[nparams] = tuple
		}

		// keyword arguments
		paramIdents := fn.funcode.Locals[:nparams]
		for _, pair := range kwargs {
			k, v := pair[0].(String), pair[1]
			if i := findParam(paramIdents, string(k)); i >= 0 {
				if defined.set(i) {
					return fmt.Errorf("function %s got multiple values for keyword argument %s", fn.Name(), k)
				}
				locals[i] = v
				continue
			}
			if kwdict == nil {
				return fmt.Errorf("function %s got an unexpected keyword argument %s", fn.Name(), k)
			}
			kwdict.SetKey(k, v)
		}

		// default values
		if len(args) < nparams {
			m := nparams - len(fn.defaults) // first default

			// report errors for missing non-optional arguments
			i := len(args)
			for ; i < m; i++ {
				if !defined.get(i) {
					return fmt.Errorf("function %s takes %s %d argument%s (%d given)",
						fn.Name(),
						cond(fn.HasVarargs() || len(fn.defaults) > 0, "at least", "exactly"),
						m,
						cond(m == 1, "", "s"),
						defined.len())
				}
			}

			// set default values
			for ; i < nparams; i++ {
				if !defined.get(i) {
					locals[i] = fn.defaults[i-m]
				}
			}
		}
	} else if nactual := len(args) + len(kwargs); nactual > 0 {
		return fmt.Errorf("function %s takes no arguments (%d given)", fn.Name(), nactual)
	}
	return nil
}