// IsIn checks for needle in haystack, ci means case-insensitive.
324137
func IsIn(needle string, haystack []string, ci bool) bool {
	for _, h := range haystack {
		if (ci && Cicmp(h, needle)) || (!ci && h == needle) {
			return true
		}
	}
	return false
}
142866
func (c *Context) Is(flagName string) bool {
	if _, ok := c.NonVariable[flagName]; ok {
		return true
	}

	if _, ok := c.Variable[flagName]; ok {
		return true
	}

	return false
}
194433
func Is(expectedValue interface{}) *isMatcher {
	matcher := new(isMatcher)
	matcher.expectedValue = expectedValue
	return matcher
}
74547
func IsInvalid(err error) bool {
	if err != nil {
		switch err.(type) {
		case *Map:
			return err.(*Map).CheckInvalid()
		}
	}
	return err != nil
}
924032
func (e *ComplexExplanation) IsMatch() bool {
	return e.match != nil && e.match.(bool) || e.match == nil && e.ExplanationImpl.IsMatch()
}
1366922
func (l *Levenshtein) IsMatch(s int) bool {
	if s < len(l.dfa.states) {
		return l.dfa.states[s].match
	}
	return false
}
1142943
func ContainsInt(s []int, v int) bool {
	for _, vv := range s {
		if vv == v {
			return true
		}
	}
	return false
}
117871
func isBrand(word string) (string, bool) {
	brand, ok := brands[strings.ToLower(word)]
	return brand, ok
}
246065
func BitIn(index int, bitset uint) uint {
	if index < 0 {
		return 0
	}

	var idx uint = 1 << uint(index)
	if idx&bitset != 0 {
		return idx
	}

	return 0
}
1258602
func (p Point) IsInf() bool {
	return math.IsInf(p.x, 0) || math.IsInf(p.y, 0)
}
687853
func (s SourceFilesystems) IsI18n(filename string) bool {
	return s.I18n.Contains(filename)
}
1201927
func hasCap(needle string, haystack []corev1.Capability) bool {
	for _, c := range haystack {
		if needle == strings.ToUpper(string(c)) {
			return true
		}
	}
	return false
}
1145467
func InArrayStringCaseInsensitive(haystack []string, needle string) (string, error) {
	needleLower := strings.ToLower(strings.TrimSpace(needle))
	for _, canonical := range haystack {
		canonicalLower := strings.ToLower(canonical)
		if canonicalLower == needleLower {
			return canonical, nil
		}
	}
	return "", errors.New("String not found")
}
1184615
func IsScalar(v Value) bool {
	switch v.(type) {
	case String:
		return true
	case Number:
		return true
	case Boolean:
		return true
	case Null:
		return true
	}
	return false
}
1341853
func Contains(haystack Value, needle Value) (bool, error) {
	res := false
	_, err := Iterate(haystack, func(k Value, v Value, l Loop) (bool, error) {
		if Equal(v, needle) {
			res = true
			return true, nil // break
		}
		return false, nil
	})
	if err != nil {
		return false, err
	}
	return res, nil
}
466443
func IsAllBytesIn(bs, encoding []byte) bool {
	var is = true
	for i := 0; i < len(bs) && is; i++ {
		is = index.ByteIn(bs[i], encoding...) >= 0
	}

	return is
}
567345
func isNil(v reflect.Value) bool {
	switch v.Kind() {
	case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
		return v.IsNil()
	}
	return false
}