// ParamOk returns the value of a param and a boolean that indicates if the param exists.
425411
func (p *ctx) ParamOk(key string) (string, bool) {
	for _, p := range p.params {
		if p.Key == key {
			return p.Val, true
		}
	}

	if c, ok := p.parent.(Context); ok {
		return c.ParamOk(key)
	} else if val, ok := p.parent.Value(key).(string); ok {
		return val, ok
	}

	return "", false
}
977516
func convertParamToMap(p APIParameter) (m map[string]interface{}) {
	m = make(map[string]interface{})
	v := reflect.ValueOf(p).Elem()
	for i := 0; i < v.NumField(); i++ {
		if unicode.IsUpper(rune(v.Type().Field(i).Name[0])) {
			m[strings.ToLower(v.Type().Field(i).Name)] = v.Field(i).Interface()
		}
	}
	return m
}
239381
func (mmap MarshalMap) Bool(key string) (bool, error) {
	val, exists := mmap.Value(key)
	if !exists {
		return false, fmt.Errorf(`"%s" is not set`, key)
	}

	boolValue, isBool := val.(bool)
	if !isBool {
		return false, fmt.Errorf(`"%s" is expected to be a boolean`, key)
	}
	return boolValue, nil
}
910762
func Params(req *http.Request) ParamCol {
	if value, ok := httpcontext.GetOk(req, paramsKey); ok {
		return ParamCol(value.(map[string]string))
	}
	return ParamCol{}
}
62214
func ParamDefined(r *http.Request, name string) bool {
	_, defined := r.URL.Query()[name]
	return defined
}
408935
func (config VoiceConfig) params() (map[string]string, error) {
	params, _ := config.BaseFile.params()

	if config.Duration != 0 {
		params["duration"] = strconv.Itoa(config.Duration)
	}
	if config.Caption != "" {
		params["caption"] = config.Caption
		if config.ParseMode != "" {
			params["parse_mode"] = config.ParseMode
		}
	}

	return params, nil
}
809227
func (p *Params) Bool(key string) (bool, error) {
	return strconv.ParseBool(p.Get(key))
}
8257
func (p *Params) MustBool(key string, defaults ...bool) bool {
	r, err := strconv.ParseBool(p.Get(key))
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return r
}
3593
func (cmd *CLI) Param(name string) values.Value {
	value, ok := cmd.Params()[name]
	if !ok {
		panic(fmt.Sprintf("param not defined %v", name))
	}
	return value
}
1129035
func (b *RouteBuilder) Param(parameter *Parameter) *RouteBuilder {
	if b.parameters == nil {
		b.parameters = []*Parameter{}
	}
	b.parameters = append(b.parameters, parameter)
	return b
}
1362361
func (conn *Connection) DoOK(cmd string, args ...interface{}) (bool, error) {
	value, err := conn.DoValue(cmd, args...)
	if err != nil {
		return false, err
	}
	return value.IsOK(), nil
}
261282
func (b *HttpRequest) Param(key, value string) *HttpRequest {
	b.params[key] = value
	return b
}
1003779
func (s *Script) Params(params map[string]interface{}) *Script {
	s.params = params
	return s
}
1133495
func Param(r *http.Request, key string) string {
	p := Params(r)
	if v, ok := p[key]; ok {
		return v
	}
	return ""
}
811705
func Params(r *http.Request) map[string]string {
	v := r.Context().Value(routeParamsID)
	if v == nil {
		return map[string]string{}
	}
	if v, ok := v.(map[string]string); ok {
		return v
	}
	return map[string]string{}
}
1088276
func (s ScriptSort) Param(name string, value interface{}) ScriptSort {
	s.params[name] = value
	return s
}
978481
func (f *Fn) SyscallParamList() string {
	a := make([]string, 0)
	for _, p := range f.Params {
		a = append(a, p.SyscallArgList()...)
	}
	for len(a) < f.SyscallParamCount() {
		a = append(a, "0")
	}
	return strings.Join(a, ", ")
}