Check if a certain value is in range

@param range range info
@param val the value to check;
@return true if it is in range, false otherwise.
425021
public static boolean inRange(Range range, double val) {
        return val >= range.min() && val <= range.max();
    }
849299
public final boolean intersects(final DateRange range) {
        boolean intersects = false;
        // Test for our start date in period
        // (Exclude if it is the end date of test range)
        if (range.includes(rangeStart) && !range.getRangeEnd().equals(rangeStart)) {
            intersects = true;
        }
        // Test for test range's start date in our range
        // (Exclude if it is the end date of our range)
        else if (includes(range.getRangeStart())
                && !rangeEnd.equals(range.getRangeStart())) {
            intersects = true;
        }
        return intersects;
    }
137185
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	public static boolean isInRange(@Nonnull final Number number, @Nonnull final BigDecimal min, @Nonnull final BigDecimal max) {
		Check.notNull(number, "number");
		Check.notNull(min, "min");
		Check.notNull(max, "max");

		BigDecimal bigDecimal = null;
		if (number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long) {
			bigDecimal = new BigDecimal(number.longValue());
		} else if (number instanceof Float || number instanceof Double) {
			bigDecimal = new BigDecimal(number.doubleValue());
		} else if (number instanceof BigInteger) {
			bigDecimal = new BigDecimal((BigInteger) number);
		} else if (number instanceof BigDecimal) {
			bigDecimal = (BigDecimal) number;
		} else {
			throw new IllegalNumberArgumentException("Return value is no known subclass of 'java.lang.Number': "
					+ number.getClass().getName());
		}
		return max.compareTo(bigDecimal) >= 0 && min.compareTo(bigDecimal) <= 0;
	}
1159101
public boolean containsRange(final Range<T> other) {
        if (other == null) {
            return false;
        }

        return (other.lowerEndpoint.isClosed ? contains(other.lowerEndpoint.value) : lowerEndpoint.value.compareTo(other.lowerEndpoint.value) <= 0)
                && (other.upperEndpoint.isClosed ? contains(other.upperEndpoint.value) : upperEndpoint.value.compareTo(other.upperEndpoint.value) >= 0);
    }
1048598
public static function max($val, $maxRange): bool
    {
        return self::size($val, null, (int)$maxRange);
    }
1061419
@Override
    public boolean overlaps(Range<T> other) {
        dbc.precondition(other != null, "checking for overlaps between a DenseRange<T> and null");
        if (other instanceof DenseRange == false) {
            return other.overlaps(this);
        }
        return !Order.of(comparator, Optional.of(this.begin()), other.end()).isGte() && !Order.of(comparator, Optional.of(other.begin()), this.end()).isGte();
    }
1021113
def is_in(val, items):
    
    if isinstance(items, basestring):
        items = items.split('|')
    return val in items
1320185
private static <T extends Comparable<T>> void ensureValidRange(T min, T max) {
    if (min == null) {
      throw new InvalidOperationException("Null value for minimum.");
    }
    if (max == null) {
      throw new InvalidOperationException("Null value for maximum.");
    }
    if (min.compareTo(max) >= 0) {
      throw new InvalidOperationException("Invalid range: " + min + " >= " + max);
    }
  }
791588
@Override
    boolean hasReference(RangeVariable range) {

        if (range == rangeVariable) {
            return true;
        }

        for (int i = 0; i < nodes.length; i++) {
            if (nodes[i] != null) {
                if (nodes[i].hasReference(range)) {
                    return true;
                }
            }
        }

        return false;
    }
213097
public boolean isAccepted(Iterable<MediaType> ranges) {
        requireNonNull(ranges, "ranges");
        return mediaTypes.match(ranges).isPresent();
    }
1169387
@VisibleForTesting
    protected void isInRange(final FieldValue<?> fieldValue) {
        if (fieldValue instanceof IntegerFieldValue) {
            final int value = ((IntegerFieldValue) fieldValue).getValue();
            if (!constraints.isInRange(value)) {
                throw new IllegalArgumentException(String.format(OORANGE, value, constraints.getStartRange(), constraints.getEndRange()));
            }
        }
    }
197917
public static int count(final Iterable<Range<Long>> ranges) {
        int count = 0;
        for (Range<Long> range : ranges) {
            checkClosedOpen(range);
            count++;
        }
        return count;
    }
664014
public static boolean isValid(@Nullable final String hourRange) {
        if (hourRange == null) {
            return true;
        }
        final int p = hourRange.indexOf('-');
        if (p != 5) {
            return false;
        }
        final String fromStr = hourRange.substring(0, 5);
        final String toStr = hourRange.substring(6);
        if (!(Hour.isValid(fromStr) && Hour.isValid(toStr))) {
            return false;
        }
        final Hour from = new Hour(fromStr);
        final Hour to = new Hour(toStr);
        if (from.equals(to)) {
            return false;
        }
        if (from.equals(new Hour(24, 0))) {
            return false;
        }
        return !to.equals(new Hour(0, 0));
    }
1351626
public final boolean adjacent(final DateRange range) {
        boolean adjacent = false;
        if (rangeStart.equals(range.getRangeEnd())) {
            adjacent = true;
        } else if (rangeEnd.equals(range.getRangeStart())) {
            adjacent = true;
        }
        return adjacent;
    }
226948
def _validate(self, val):
        
        if self.allow_None and val is None:
            return
        super(Range, self)._validate(val)

        self._checkBounds(val)
1250119
@Override
  public boolean contains(IVersion version)
  {
    return range1.contains(version) && range2.contains(version);
  }
1182422
function isInRange(node, reference) {
    const or = node.range;
    const ir = reference.identifier.range;

    return or[0] <= ir[0] && ir[1] <= or[1];
}