// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if
// it exists, the value is boolean.  If the tag did not exist, it returns
// false.
975579
func extractBoolTagOrDie(key string, lines []string) bool {
	val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines)
	if err != nil {
		klog.Fatal(err)
	}
	return val
}
634340
func (v *Validator) TypeBool(field string) *ValidationResult {
	if _, err := strconv.ParseBool(v.data.Get(field)); err != nil {
		// note: "true or false" is a more natural colloquial term than "bool"
		return v.addTypeError(field, "true or false")
	} else {
		return validationOk
	}
}
474035
func FindEC2Tag(tags []*ec2.Tag, key string) (string, bool) {
	for _, tag := range tags {
		if key == aws.StringValue(tag.Key) {
			return aws.StringValue(tag.Value), true
		}
	}
	return "", false
}
1137017
func parseBoolOrAuto(s string) (*bool, error) {
	if s == "" || strings.ToLower(s) == "auto" {
		return nil, nil
	}
	b, err := strconv.ParseBool(s)
	return &b, err
}
280836
func getBoolValue(b []rune) (int, error) {
	if len(b) < 4 {
		return 0, NewParseError("invalid boolean value")
	}

	n := 0
	for _, lv := range literalValues {
		if len(lv) > len(b) {
			continue
		}

		if isLitValue(lv, b) {
			n = len(lv)
		}
	}

	if n == 0 {
		return 0, NewParseError("invalid boolean value")
	}

	return n, nil
}
674570
func ParseBool(b string) *bool {
	var truth bool
	switch b {
	case "enabled":
		truth = true
	case "disabled":
		truth = false
	default:
		return nil
	}
	return &truth
}
151932
func (reader *PluginConfigReader) GetBool(key string, defaultValue bool) bool {
	value, err := reader.WithError.GetBool(key, defaultValue)
	reader.Errors.Push(err)
	return value
}
570599
func NewBooleanNode(operator lex.Token, args ...Node) *BooleanNode {
	//u.Debugf("NewBinaryNode: %v %v %v", lhArg, operator, rhArg)
	return &BooleanNode{Args: args, Operator: operator}
}
715447
func (c *IniConfigContainer) DefaultBool(key string, defaultval bool) bool {
	v, err := c.Bool(key)
	if err != nil {
		return defaultval
	}
	return v
}
317490
func (s *Session) GetBoolean(key string) (bool, error) {
	v := s.Get(key)
	if v == nil {
		return false, errFindParse.Format("bool", key, "nil")
	}

	// here we could check for "true", "false" and 0 for false and 1 for true
	// but this may cause unexpected behavior from the developer if they expecting an error
	// so we just check if bool, if yes then return that bool, otherwise return false and an error.
	if vb, ok := v.(bool); ok {
		return vb, nil
	}
	if vstring, ok := v.(string); ok {
		return strconv.ParseBool(vstring)
	}

	return false, errFindParse.Format("bool", key, v)
}
1191554
func (enc *Encoder) AddBoolKey(key string, v bool) {
	enc.BoolKey(key, v)
}
430418
func ExtractHighlightPostTag(opts ...interface{}) *opt.HighlightPostTagOption {
	for _, o := range opts {
		if v, ok := o.(*opt.HighlightPostTagOption); ok {
			return v
		}
	}
	return nil
}
388538
func (s *Session) GetBool(key string) bool {
	r, _ := s.Get(key).(bool)
	return r
}
514781
func (n *NullBool) ParseBoolValue(val *bool) {
	if val == nil {
		n.IsSet = false
		n.Value = false
		return
	}

	n.Value = *val
	n.IsSet = true
}
428255
func (blk *TagBlock) DecodeTagValueElem(key, value []byte, valueElem *TagBlockValueElem) bool {
	// Find key element, exit if not found.
	var keyElem TagBlockKeyElem
	if !blk.DecodeTagKeyElem(key, &keyElem) {
		return false
	}

	// Slice hash index data.
	hashData := keyElem.hashIndex.buf

	valueN := int64(binary.BigEndian.Uint64(hashData[:TagValueNSize]))
	hash := rhh.HashKey(value)
	pos := hash % valueN

	// Track current distance
	var d int64
	for {
		// Find offset of tag value.
		offset := binary.BigEndian.Uint64(hashData[TagValueNSize+(pos*TagValueOffsetSize):])
		if offset == 0 {
			return false
		}

		// Parse into element.
		valueElem.unmarshal(blk.data[offset:])

		// Return if values match.
		if bytes.Equal(valueElem.value, value) {
			return true
		}

		// Check if we've exceeded the probe distance.
		max := rhh.Dist(rhh.HashKey(valueElem.value), pos, valueN)
		if d > max {
			return false
		}

		// Move position forward.
		pos = (pos + 1) % valueN
		d++

		if d > valueN {
			return false
		}
	}
}
1001157
func FindELBV2Tag(tags []*elbv2.Tag, key string) (string, bool) {
	for _, tag := range tags {
		if key == aws.StringValue(tag.Key) {
			return aws.StringValue(tag.Value), true
		}
	}
	return "", false
}
150942
func FindELBTag(tags []*elb.Tag, key string) (string, bool) {
	for _, tag := range tags {
		if key == aws.StringValue(tag.Key) {
			return aws.StringValue(tag.Value), true
		}
	}
	return "", false
}