// InRange returns true if value lies between left and right border, generic type to handle int, float32 or float64, all types must the same type
174176
func InRange(value interface{}, left interface{}, right interface{}) bool {

	reflectValue := reflect.TypeOf(value).Kind()
	reflectLeft := reflect.TypeOf(left).Kind()
	reflectRight := reflect.TypeOf(right).Kind()

	if reflectValue == reflect.Int && reflectLeft == reflect.Int && reflectRight == reflect.Int {
		return InRangeInt(value.(int), left.(int), right.(int))
	} else if reflectValue == reflect.Float32 && reflectLeft == reflect.Float32 && reflectRight == reflect.Float32 {
		return InRangeFloat32(value.(float32), left.(float32), right.(float32))
	} else if reflectValue == reflect.Float64 && reflectLeft == reflect.Float64 && reflectRight == reflect.Float64 {
		return InRangeFloat64(value.(float64), left.(float64), right.(float64))
	} else {
		return false
	}
}
180497
func YearInRange(t time.Time, minYear, maxYear int) bool {
	return (minYear <= t.Year()) && (t.Year() <= maxYear)
}
1373292
func splitRange(value string) (string, string, error) {
	p := strings.SplitN(value, ",", 2)
	if len(p) != 2 || p[0] == "" || p[1] == "" {
		return "", "", fmt.Errorf("date: failed to parse date range '%s'", value)
	}
	return strings.ToLower(p[0][1:]), strings.ToLower(p[1][:len(p[1])-1]), nil
}
179100
func CheckIPInRange(ip string, start net.IP, end net.IP) bool {
	//sanity check
	input := net.ParseIP(ip)
	if input.To4() == nil {
		log.Printf("%v is not a valid IPv4 address", input)
		return false
	}

	if bytes.Compare(input, start) >= 0 && bytes.Compare(input, end) <= 0 {
		return true
	}

	log.Printf("%v is NOT between %v and %v", input, start, end)
	return false
}
697377
func (tr Ranges) AddRange(r Range) Ranges {
	res := tr.clone()
	res.addRangeInPlace(r)
	return res
}
813218
func parseLexrange(s string) (string, bool, error) {
	if len(s) == 0 {
		return "", false, errInvalidRangeItem
	}
	if s == "+" || s == "-" {
		return s, false, nil
	}
	switch s[0] {
	case '(':
		return s[1:], false, nil
	case '[':
		return s[1:], true, nil
	default:
		return "", false, errInvalidRangeItem
	}
}
685443
func (s *ObjectAttributeRange) SetRange(v *TypedAttributeValueRange) *ObjectAttributeRange {
	s.Range = v
	return s
}
748317
func Range(start, end float64) []float64 {
	return Seq{NewLinear().WithStart(start).WithEnd(end).WithStep(1.0)}.Array()
}
1124027
func (dt *DateTime) InRange(min, max time.Time) *DateTime {
	if !((dt.value.After(min) || dt.value.Equal(min)) &&
		(dt.value.Before(max) || dt.value.Equal(max))) {
		dt.chain.fail(
			"\nexpected datetime in range:\n min: %s\n max: %s\n\nbut got: %s",
			min, max, dt.value)
	}
	return dt
}
39362
func InRangeFloat32(value, left, right float32) bool {
	if left > right {
		left, right = right, left
	}
	return value >= left && value <= right
}
1081142
func Range(start, end int) []int {
	if end < start {
		panic("range must have end greater than or equal to start")
	}
	r := make([]int, end-start)
	for i := start; i < end; i++ {
		r[i-start] = i
	}
	return r
}
169937
func MinuteInRange(t time.Time, minMinute, maxMinute int) bool {
	return (minMinute <= t.Minute()) && (t.Minute() <= maxMinute)
}
136115
func parseDecInRange(s string, start, stop, min, max int) (int, error) {
	result, err := parseDec(s, start, stop)
	switch {
	case err != nil:
		return result, err
	case result < min || max <= result:
		return result, fmt.Errorf("value out of range: %d, want %d-%d", result, min, max)
	}
	return result, nil
}
87731
func (fa *fa_IR) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
	return locales.PluralRuleOther
}
711773
func (db *BytesConnectionEtcd) ListValuesRange(fromPrefix string, toPrefix string) (keyval.BytesKeyValIterator, error) {
	return listValuesRangeInternal(db.Logger, db.etcdClient, db.opTimeout, fromPrefix, toPrefix)
}
310569
func (s *SeqSet) AddRange(Start, Stop uint32) {
	if (Stop < Start && Stop != 0) || Start == 0 {
		s.insert(Seq{Stop, Start})
	} else {
		s.insert(Seq{Start, Stop})
	}
}
642020
func (g GridType) XRange() (min, max float64) {
	min = g.xTicks[0]
	max = g.xTicks[len(g.xTicks)-1]
	return
}