// IsBool checks if a given value is a bool value, i.e. implements the BoolValued interface
171790
func IsBool(v flag.Value) bool {
	if bf, ok := v.(BoolValued); ok {
		return bf.IsBoolFlag()
	}

	return false
}
601153
func (dec *Decoder) Bool(v *bool) error {
	err := dec.decodeBool(v)
	if err != nil {
		return err
	}
	dec.called |= 1
	return nil
}
625353
func (c *ConfigParser) Getbool(section, option string) (val bool, err error) {
	sv, err := c.Get(section, option)
	if err != nil {
		return val, err
	}

	val, ok := booleanStates[strings.ToLower(sv)]
	if !ok {
		return val, errors.New(fmt.Sprintf("No boolean: %s", sv))
	}

	return val, err
}
1286374
func (fv FlagValues) Bool(name string, defaultValue bool) (bool, error) {
	value, found := fv[name]
	if !found {
		return defaultValue, nil
	}
	switch value {
	case "", "t", "T", "true", "True", "1":
		return true, nil
	case "f", "F", "false", "False", "0":
		return false, nil
	}
	return false, fmt.Errorf("flag %q: cannot parse boolean from %q", name, value)
}
453828
func (a *Array) Bool(b bool) *Array {
	a.buf = enc.AppendBool(enc.AppendArrayDelim(a.buf), b)
	return a
}
65654
func (b Bool) Bool() bool {
	if b.Initialized {
		return b.Val
	}
	return b.Default
}
1063600
func Bool(value interface{}) bool {
	b, _ := strconv.ParseBool(String(value))
	return b
}
171332
func checkAgainstBool(e bool, c reflect.Value) (err error) {
	if c.Kind() != reflect.Bool {
		err = NewFatalError("which is not a bool")
		return
	}

	err = errors.New("")
	if c.Bool() == e {
		err = nil
	}
	return
}
808503
func Bool(b bool) NullBool {
	return NullBool{
		sql.NullBool{
			Bool:  b,
			Valid: true,
		},
	}
}
1013496
func optionalBool(arg []bool, defaultValue bool) bool {
	if len(arg) == 0 {
		return defaultValue
	}
	return arg[0]
}
368910
func (f *Queries) Bool(key string) (bool, error) {
	s, err := f.String(key)
	if err != nil {
		return false, err
	}
	return strconv.ParseBool(s)
}
1130130
func typeIsBool(typ reflect.Type) bool {
	k := typ.Kind()
	return k == reflect.Bool
}
611788
func (c *Cell) Bool() bool {
	// If bool, just return the value.
	if c.cellType == CellTypeBool {
		return c.Value == "1"
	}
	// If numeric, base it on a non-zero.
	if c.cellType == CellTypeNumeric {
		return c.Value != "0"
	}
	// Return whether there's an empty string.
	return c.Value != ""
}
814317
func (node *Node) GetBool(key string) bool {
	b, _ := strconv.ParseBool(node.Values.Get(key))
	return b
}
1103609
func ToBool(in interface{}) bool {
	if b, ok := in.(bool); ok {
		return b
	}

	if str, ok := in.(string); ok {
		str = strings.ToLower(str)
		switch str {
		case "1", "t", "true", "yes":
			return true
		default:
			return strToFloat64(str) == 1
		}
	}

	val := reflect.Indirect(reflect.ValueOf(in))
	switch val.Kind() {
	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
		return val.Int() == 1
	case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
		return val.Uint() == 1
	case reflect.Float32, reflect.Float64:
		return val.Float() == 1
	default:
		return false
	}
}
96133
func (ec *Envcfg) GetBool(key string) bool {
	b, _ := strconv.ParseBool(ec.GetKey(key))
	return b
}
877281
func (d Data) GetBool(key string) bool {
	if !d.KeyExists(key) || len(d.Values[key]) == 0 {
		return false
	}
	str := d.Get(key)
	if result, err := strconv.ParseBool(str); err != nil {
		panic(err)
	} else {
		return result
	}
}