Checks if the given interval is valid. A valid interval
    is always a positive, non-zero integer value.
492172
def is_valid_interval(interval):
    
    if not isinstance(interval, (int, long)):
        return False

    if interval <= 0:
        return False

    return True
204439
public boolean validate() {

        if (m_end >= m_length) {
            m_end = m_length - 1;
        }

        return ((m_start >= 0) && (m_end >= 0) && (m_start <= m_end) && (m_length > 0));
    }
1195239
def strictly_positive_int_or_none(val):
    """"""
    val = positive_int_or_none(val)
    if val is None or val > 0:
        return val
    raise ValueError('"{}" must be strictly positive'.format(val))
90680
def is_int(value):
    """"""
    if isinstance(value, bool):
        return False
    try:
        int(value)
        return True
    except (ValueError, TypeError):
        return False
582023
def validate_non_negative_int_or_basestring(option, value):
    
    if isinstance(value, integer_types):
        return value
    elif isinstance(value, string_type):
        try:
            val = int(value)
        except ValueError:
            return value
        return validate_non_negative_integer(option, val)
    raise TypeError("Wrong type for %s, value must be an "
                    "non negative integer or a string" % (option,))
24103
public void validate() {
    if (interval == null || interval.isEmpty()) {
      throw new IllegalArgumentException("Missing or empty interval");
    }
    DateTime.parseDuration(interval);
    
    if (aggregator == null || aggregator.isEmpty()) {
      throw new IllegalArgumentException("Missing or empty aggregator");
    }
    try {
      Aggregators.get(aggregator.toLowerCase());
    } catch (final NoSuchElementException e) {
      throw new IllegalArgumentException("Invalid aggregator");
    }
    
    if (fill_policy != null) {
      fill_policy.validate();
    }
  }
42756
def is_valid_esi(esi):
    """"""
    if isinstance(esi, numbers.Integral):
        return 0 <= esi <= 0xffffffffffffffffff
    return isinstance(esi, dict)
685046
def reload_interval=(interval)
      raise ArgumentError, 'Argument must be Integer.' unless interval.kind_of?(Integer)
      self.enable_reload = false if interval == 0  # Sett
      self.reload_interval = interval
    end
986687
def validate(self, instance, value):
        """"""
        try:
            intval = int(value)
            if not self.cast and abs(value - intval) > TOL:
                self.error(
                    instance=instance,
                    value=value,
                    extra='Not within tolerance range of {}.'.format(TOL),
                )
        except (TypeError, ValueError):
            self.error(instance, value, extra='Cannot cast to integer.')
        _in_bounds(self, instance, intval)
        return intval
183240
def valid(self, value, level=[]):
		

		# Reset validation failures
		self.validation_failures = []

		# If the value is None and it's optional, we're good
		if value is None and self._optional:
			return True

		# Go through each of the nodes
		for i in range(len(self._nodes)):

			# If it's valid
			if self._nodes[i].valid(value):

				# Return OK
				return True

		# Not valid for anything
		self.validation_failures.append(('.'.join(level), 'no valid option'))
		return False
373799
public boolean valid()
    {
        boolean valid = true;
        if (tc.isEntryEnabled())
            Tr.entry(tc, "valid", this);
        if (_status == STATUS_INVALID)
            valid = false;
        if (tc.isEntryEnabled())
            Tr.exit(tc, "valid", new Boolean(valid));
        return valid;
    }
1333241
def check_positive_integer(name, value):
    
    try:
        value = int(value)
        is_positive = (value > 0)
    except ValueError:
        raise ValueError('%s should be an integer; got %r' % (name, value))

    if is_positive:
        return value
    else:
        raise ValueError('%s should be positive; got %r' % (name, value))
273284
def valid(number):
    
    checksum = 0

    number_len = len(number)
    offset = ord('0')

    i = number_len - 1
    while i >= 0:
      n = ord(number[i]) - offset
      checksum += n
      i -= 2

    i = number_len - 2
    while i >= 0:
      n = ord(number[i]) - offset
      n *= 2
      if n > 9:
          n -= 9
      checksum += n
      i -= 2

    return checksum%10 == 0
1012447
def check_valid_border(border):
    
    if border is not None and (int(border) != border or border < 0):
        raise ValueError('The border must not a non-negative integer value. '
                         'Got: "{0}"'.format(border))
1183962
def __int(value):
    ''''''
    valid, _value = False, value
    try:
        _value = int(value)
        valid = True
    except ValueError:
        pass
    return (valid, _value, 'integer')
458453
public static boolean checkValidInterval(int interval, TimeUnit unit)
    {
        if (0 >= interval || INTERVAL_MAX < interval)
        {
            return false;
        }

        switch (unit)
        {
        case HOURS:
            break;
        case MINUTES:
            break;
        case SECONDS:
            break;
        case MILLISECONDS:
            break;
        default:
            return false;
        }

        return true;
    }
158861
public static boolean isIntValue(final String value) {
        try {
            Integer.parseInt(value);
            return true;
        } catch (final NumberFormatException ex) {
            return false;
        }
    }