// ParamBoolean returns boolean value from the form or query
323084
func ParamBoolean(r *http.Request, name string, defaultValue bool) bool {
	value, err := strconv.ParseBool(r.FormValue(name))
	if err != nil {
		return defaultValue
	}
	return value
}
262758
func OptFieldTypeBool() FieldOption {
	return func(fo *FieldOptions) error {
		if fo.Type != "" {
			return errors.Errorf("field type is already set to: %s", fo.Type)
		}
		fo.Type = FieldTypeBool
		return nil
	}
}
612198
func ParamBodyJson(r *http.Request, v interface{}, closeBody ...bool) error {
	defer func() {
		if len(closeBody) == 0 || closeBody[0] {
			r.Body.Close()
		}
	}()
	decoder := json.NewDecoder(r.Body)
	return decoder.Decode(v)
}
887224
func (t *typeChecker) AcceptBooleanLiteral(v tree.BooleanLiteral) {
	if !t.expectBoolean {
		t.result = fmt.Errorf("expected numeric expression but found: %s", tree.ExpressionString(v))
	}
}
686980
func (bo *bo_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
	return locales.PluralRuleOther
}
488144
func ParseBool(value string) (bool, error) {
	switch strings.ToLower(value) {
	case "yes", "yeah", "y", "true", "1", "on":
		return true, nil
	case "no", "nope", "n", "false", "0", "off":
		return false, nil
	default:
		return false, trace.BadParameter("unsupported value: %q", value)
	}
}
130014
func (v *printVisitor) VisitBoolean(node *BooleanLiteral) interface{} {
	if v.original {
		v.str(node.Original)
	} else {
		v.str(fmt.Sprintf("BOOLEAN{%s}", node.Canonical()))
	}

	return nil
}
1361697
func (d *Context) ToBoolean(index int) bool {
	return int(C.duk_to_boolean(d.duk_context, C.duk_idx_t(index))) == 1
}
1161786
func IsNoPager(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyNoPager).(bool)
	if !ok {
		return false
	}
	return bv
}
872837
func (p *point) BooleanValue() (bool, error) {
	b, err := parseBoolBytes(p.it.valueBuf)
	if err != nil {
		return false, fmt.Errorf("unable to parse bool value %q: %v", p.it.valueBuf, err)
	}
	return b, nil
}
1090780
func NewBooleanFieldMapping() *FieldMapping {
	return &FieldMapping{
		Type:         "boolean",
		Store:        true,
		Index:        true,
		IncludeInAll: true,
		DocValues:    true,
	}
}
460839
func VolumeActionParamSimpleValueOf(s string) (VolumeActionParam, error) {
	obj, err := simpleValueOf("volume_action_param", VolumeActionParam_value, s)
	return VolumeActionParam(obj), err
}
547944
func (state *UserState) BooleanField(username, fieldname string) bool {
	hasUser := state.HasUser(username)
	if !hasUser {
		return false
	}
	value, err := state.users.Get(username, fieldname)
	if err != nil {
		return false
	}
	return value == "true"
}
776722
func queryParam(req *http.Request, param string) (bool, error) {
	err := req.ParseForm()
	if err != nil {
		return false, err
	}
	if _, ok := req.Form[param]; ok {
		return true, nil
	}
	return false, nil
}
200288
func (schema *Schema) schemaOrBooleanValue(v interface{}) *SchemaOrBoolean {
	schemaOrBoolean := &SchemaOrBoolean{}
	switch v := v.(type) {
	case bool:
		schemaOrBoolean.Boolean = &v
	case yaml.MapSlice:
		schemaOrBoolean.Schema = NewSchemaFromObject(v)
	default:
		fmt.Printf("schemaOrBooleanValue: unexpected type %T\n", v)
	case []map[string]interface{}:

	}
	return schemaOrBoolean
}
449885
func (list *List) GetBoolean(idx int) (bool, error) {
	value, err := list.Get(idx)
	if err != nil {
		return false, err
	}

	switch value.(type) {
	case *Primative:
		return value.(*Primative).AsBoolean()
	}

	return false, errors.New("could not convert unknown value to boolean")
}
337689
func (f FindOptions) QueryParams() map[string][]string {
	qp := map[string][]string{
		"offset":     {strconv.Itoa(f.Offset)},
		"descending": {strconv.FormatBool(f.Descending)},
	}

	if f.Limit > 0 {
		qp["limit"] = []string{strconv.Itoa(f.Limit)}
	}

	if f.SortBy != "" {
		qp["sortBy"] = []string{f.SortBy}
	}

	return qp
}