// Boolean logic.
354744
func truth(a interface{}) bool {
	t, _ := isTrue(reflect.ValueOf(a))
	return t
}
1188189
func (f *Flag) Bool(name string) (bool, error) {
	v, err := f.value(name)
	if err != nil {
		return false, err
	}

	return strconv.ParseBool(v)
}
839706
func (is *Is) True(b bool) {
	is.TB.Helper()
	if !b {
		fail(is, "expected boolean to be true")
	}
}
43231
func is(lhs Expression, val interface{}) BooleanExpression {
	return checkBoolExpType(IS_OP, lhs, val, false)
}
884075
func Bool(v interface{}, err error) (bool, error) {
	if err != nil {
		return false, err
	}
	vb, ok := v.(bool)
	if ok {
		return vb, nil
	}

	return false, newWrongTypeError(v, vb)

}
1244595
func (p *Prompt) Bool(q string, def bool) (bool, error) {
	w := &w{}
	w.print(p.output, colors.Default, q)
	str := "Y"
	if !def {
		str = "N"
	}
	w.print(p.output, p.defaultColor, "（", str, "）")
	w.print(p.output, colors.Default, "：")

	val := w.read(p)
	if w.err != nil {
		return false, w.err
	}

	switch strings.ToLower(val) {
	case "yes", "y":
		return true, nil
	case "no", "n":
		return false, nil
	default:
		return def, nil
	}
}
65654
func (b Bool) Bool() bool {
	if b.Initialized {
		return b.Val
	}
	return b.Default
}
722641
func booleanFunc(q query, t iterator) interface{} {
	v := q.Evaluate(t)
	return asBool(t, v)
}
808503
func Bool(b bool) NullBool {
	return NullBool{
		sql.NullBool{
			Bool:  b,
			Valid: true,
		},
	}
}
1173503
func (e *Expect) Boolean(value bool) *Boolean {
	return NewBoolean(e.config.Reporter, value)
}
1009321
func False(t TestingT, value bool, msgAndArgs ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}

	if value != false {
		return Fail(t, "Should be false", msgAndArgs...)
	}

	return true

}
171790
func IsBool(v flag.Value) bool {
	if bf, ok := v.(BoolValued); ok {
		return bf.IsBoolFlag()
	}

	return false
}
483088
func Bool(v bool) *bool {
	ptr := new(bool)
	*ptr = v
	return ptr
}
939979
func BoolP(val string) (*bool, error) {
	b, err := Bool(val)
	if err != nil {
		return nil, err
	}
	return proto.Bool(b), nil
}
89705
func GetBoolean(data []byte, keys ...string) (val bool, err error) {
	v, t, _, e := Get(data, keys...)

	if e != nil {
		return false, e
	}

	if t != Boolean {
		return false, fmt.Errorf("Value is not a boolean: %s", string(v))
	}

	return ParseBoolean(v)
}
306895
func iface2bool(a interface{}) (bool, error) {
	switch a.(type) {
	case int:
		if a.(int) == 1 {
			return true, nil
		}
		return false, nil
	}
	return false, fmt.Errorf("redis: %#v is not boolean", a)
}
1335393
func (self *Commands) False(value interface{}) error {
	if stringutil.IsBooleanFalse(value) {
		return nil
	} else {
		return fmt.Errorf("Expected false value")
	}
}