// Option return the value for the specified key. Empty string is returned if
// key does not exists.
355162
func (s *Section) Option(key string) string {
	return s.Options.Get(key)
}
684030
func OptionCheck(args []string) (err error) {
	opt := newOption(ioutil.Discard, flag.ContinueOnError)
	if e := opt.parse(args); e != nil {
		return fmt.Errorf("%v, %v", CommandName, e)
	}
	return nil
}
78718
func (e Enum) ValueOptions() []string {
	optionSet := make(map[string]struct{})
	for _, value := range e.Values {
		for option := range value.Options {
			optionSet[option] = struct{}{}
		}
	}
	if len(optionSet) == 0 {
		return nil
	}
	options := make([]string, 0, len(optionSet))
	for option := range optionSet {
		options = append(options, option)
	}
	sort.Strings(options)
	return options
}
846785
func (c *ctx) Value(key interface{}) interface{} {
	if key == ctxKey {
		return c
	}

	if k, ok := key.(string); ok {
		if val, exist := c.ParamOk(k); exist {
			return val
		}
	}

	return c.parent.Value(key)
}
1068237
func (d *device) Option(opts ...Option) error {
	var err error
	for _, opt := range opts {
		err = opt(d)
	}
	return err
}
526379
func (l *listener) GetOption(name string) (interface{}, error) {
	switch name {
	case OptionInputBufferSize:
		return l.config.InputBufferSize, nil
	case OptionOutputBufferSize:
		return l.config.OutputBufferSize, nil
	case OptionSecurityDescriptor:
		return l.config.SecurityDescriptor, nil
	}
	return nil, mangos.ErrBadOption
}
322130
func Option(o map[string]interface{}) map[int]interface{} {
	rst := make(map[int]interface{})
	for k, v := range o {
		k := "OPT_" + strings.ToUpper(k)
		if num, ok := CONST[k]; ok {
			rst[num] = v
		}
	}

	return rst
}
703526
func (o options) get(name string) (interface{}, error) {
	v, ok := o[name]
	if !ok {
		return nil, mangos.ErrBadOption
	}
	return v, nil
}
366055
func (m *monitor) Option(opts ...monitorOption) monitorOption {
	var previous monitorOption
	for _, opt := range opts {
		previous = opt(m)
	}
	return previous
}
290750
func (c *APIContext) Value(key interface{}) interface{} {
	if keyAsString, ok := key.(string); ok {
		val, _ := c.Get(keyAsString)
		return val
	}
	return nil
}
945511
func (spark *Sparkline) SetOption(key string, value string) {
	if spark.Data == nil {
		spark.Options = make(map[string]string)
	}
	spark.Options[key] = value
}
1168543
func (v *KeyValue_SetValue_Args) GetValue() (o string) {
	if v != nil && v.Value != nil {
		return *v.Value
	}

	return
}
1354982
func Options(url string, v ...interface{}) (*Resp, error) {
	return std.Options(url, v...)
}
880427
func choose(args jet.Arguments) reflect.Value {
	args.RequireNumOfArguments("choose", 2, -1)

	var v reflect.Value
	for i, n := 0, args.NumOfArguments(); i < n; i++ {
		v = args.Get(i)
		if !reflects.IsEmpty(v) {
			return reflects.Indirect(v)
		}
	}
	return reflects.Indirect(v)
}
1307810
func (v *KeyValue_SetValue_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Key != nil {
		fields[i] = fmt.Sprintf("Key: %v", *(v.Key))
		i++
	}
	if v.Value != nil {
		fields[i] = fmt.Sprintf("Value: %v", *(v.Value))
		i++
	}

	return fmt.Sprintf("KeyValue_SetValue_Args{%v}", strings.Join(fields[:i], ", "))
}
161944
func (kv *KeyVal) Set(v string) error {
	if len(*kv) == 0 {
		*kv = make(map[string]string)
	}
	for _, i := range cstrings.SplitComma(v) {
		vals := strings.SplitN(i, ":", 2)
		if len(vals) != 2 {
			return trace.Errorf("extra options should be defined like KEY:VAL")
		}
		(*kv)[vals[0]] = vals[1]
	}
	return nil
}
300230
func (o *DistinctOption) Get() (bool, int) {
	if o == nil {
		return false, 0
	}
	return o.value == 1, o.value
}