of the number does not validate correctly
497683
private final boolean consumeNumber(char c) throws LazyException{
		boolean floatChar=false;
		if(c==CH_DASH){
			// If the number started with a minus sign it must be followed by at least one digit
			n++;
			c=cbuf[n];
			if(c<CH_0 || c>CH_9){
				throw new LazyException("Digit expected",n);
			}
		}
		n++;
		if(c==CH_0){
			// First digit was zero - next may not be digit!
			c=cbuf[n];
			if(c>=CH_0 && c<=CH_9){
				throw new LazyException("Number may not start with leading zero",n);
			}
		}else{
			c=cbuf[n];
		}
		while(!(c<CH_0 || c>CH_9)){
			n++;
			c=cbuf[n];
		}
		if(c==CH_DOT){
			floatChar=true;
			// The fractional part must contain one or more digits
			n++;
			c=cbuf[n];
			if(c<CH_0 || c>CH_9){
				throw new LazyException("Digit expected",n);
			}
			n++;
			c=cbuf[n];
			while(!(c<CH_0 || c>CH_9)){
				n++;
				c=cbuf[n];
			}
		}
		if(c==CH_e || c==CH_E){
			floatChar=true;
			n++;
			c=cbuf[n];
			if(c==CH_DASH || c==CH_PLUS){
				// We must have at least one digit following this
				n++;
				c=cbuf[n];
				if(c<CH_0 || c>CH_9){
					throw new LazyException("Digit expected",n);
				}
			}else if(c<CH_0 || c>CH_9){
				throw new LazyException("Exponential part expected",n);
			}
			n++;
			c=cbuf[n];
			while(!(c<CH_0 || c>CH_9)){
				n++;
				c=cbuf[n];
			}
		}
		return floatChar;
	}
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
198797
function validateNumericality(attr, conf, err) {
    if (nullCheck.call(this, attr, conf, err)) return;

    if (typeof this[attr] !== 'number') {
        return err('number');
    }
    if (conf.int && this[attr] !== Math.round(this[attr])) {
        return err('int');
    }
}
1307300
def number_check(check, return_number=True):
    
    try:
        int(check)
        good = True
    except ValueError:
        LOGGER.critical('Function number_check ValueError {item}'.format(item=check))
        good = False
    if return_number:
        while not good:
            print("That is not a number.")
            print("Please try again.")
            check = input("Please enter a number?: ")
            try:
                int(check)
                good = True
            except ValueError:
                LOGGER.critical('Function number_check ValueError {item}'.format(item=check))
                good = False
        return check
    else:
        return good
1230306
function(_number) {
    if ('undefined' == typeof _number) {
      return null;
    }
    else if ('number' != typeof(_number)) {
      throw new Error('Wrong parameter type');
    }

    var ret = '';

    for (var i = Math.floor(Math.log(parseInt(_number)) / Math.log(this.index.length)); i >= 0; i--) {
      ret = ret + this.index.substr((Math.floor(parseInt(_number) / this.bcpow(this.index.length, i)) % this.index.length), 1);
    }

    return ret.reverse();
  }
1224794
def ensure_number(num, *args, **kwargs):
    
    return num if isinstance(num, Number) else Number(num, *args, **kwargs)
834124
def validate_multiple_of(value, divisor, **kwargs):
    
    if not decimal.Decimal(str(value)) % decimal.Decimal(str(divisor)) == 0:
        raise ValidationError(
            MESSAGES['multiple_of']['invalid'].format(divisor, value),
        )
883094
function (mixed, base) {
            var type = typeof mixed;

            base = base || 10;

            if (type === "boolean") {
                return +mixed;

            } else if (type === "string") {
                mixed   = mixed.replace(/\s/g, "");
                var tmp = parseInt(mixed, base);
                return (isNaN(tmp) || !isFinite(tmp)) ? 0 : tmp;

            } else if (type === "number" && isFinite(mixed)) {
                /* jshint -W016 */
                return mixed | 0;
                /* jshint +W016 */

            } else {
                return 0;
            }
        }
1087053
def _validate_number_sequence(self, seq, n):
        
        if seq is None:
            return np.zeros(n)
        if len(seq) is n:
            try:
                l = [float(e) for e in seq]
            except ValueError:
                raise ValueError("One or more elements in sequence <" + repr(seq) + "> cannot be interpreted as a real number")
            else:
                return np.asarray(l)
        elif len(seq) is 0:
            return np.zeros(n)
        else:
            raise ValueError("Unexpected number of elements in sequence. Got: " + str(len(seq)) + ", Expected: " + str(n) + ".")
852713
def validate_image(image, number_tiles):
    """"""
    TILE_LIMIT = 99 * 99

    try:
        number_tiles = int(number_tiles)
    except:
        raise ValueError('number_tiles could not be cast to integer.')

    if number_tiles > TILE_LIMIT or number_tiles < 2:
        raise ValueError('Number of tiles must be between 2 and {} (you \
                          asked for {}).'.format(TILE_LIMIT, number_tiles))
971287
function () {

// Parse a number value.

            var number,
                string = '';

            if (ch === '-') {
                string = '-';
                next('-');
            }
            while (ch >= '0' && ch <= '9') {
                string += ch;
                next();
            }
            if (ch === '.') {
                string += '.';
                while (next() && ch >= '0' && ch <= '9') {
                    string += ch;
                }
            }
            if (ch === 'e' || ch === 'E') {
                string += ch;
                next();
                if (ch === '-' || ch === '+') {
                    string += ch;
                    next();
                }
                while (ch >= '0' && ch <= '9') {
                    string += ch;
                    next();
                }
            }
            number = +string;
            if (!isFinite(number)) {
                error("Bad number");
            } else {
                return number;
            }
        }
1238112
def validate(self, tracking_number):
        ""
        tracking_num = tracking_number[:-1].replace(' ', '')
        odd_total = 0
        even_total = 0
        for ii, digit in enumerate(tracking_num):
            if ii % 2:
                odd_total += int(digit)
            else:
                even_total += int(digit)
        total = odd_total + even_total * 3
        check = ((total - (total % 10) + 10) - total) % 10
        return (check == int(tracking_number[-1:]))
112530
def apnumber(value):
    """"""
    try:
        value = int(value)
    except (TypeError, ValueError):
        return value
    if not 0 < value < 10:
        return str(value)
    return (_('one'), _('two'), _('three'), _('four'), _('five'), _('six'),
            _('seven'), _('eight'), _('nine'))[value - 1]
389491
function(value){
      return _.isNumber(value) || (_.isString(value) && value.match(defaultPatterns.number));
    }
1056966
function filter_number(value) {
    var m = NUMBER_RE.exec(value);
    if(m == null) throw OptError('Expected a number representative');
    if(m[1]) {
        // The number is in HEX format. Convert into a number, then return it
        return parseInt(m[1], 16);
    } else {
        // The number is in regular- or decimal form. Just run in through
        // the float caster.
        return parseFloat(m[2] || m[3]);
    }
}
1267138
def FMErrorByNum( num ):
    """"""

    if not num in FMErrorNum.keys():
        raise FMServerError, (num, FMErrorNum[-1])
    elif num == 102:
        raise FMFieldError, (num, FMErrorNum[num])
    else:
        raise FMServerError, (num, FMErrorNum[num])
1305555
protected void validateEqualInteger(Integer i1, Integer i2, String errorKey, String errorMessage) {
		if (i1 == null || i2 == null || (i1.intValue() != i2.intValue())) {
			addError(errorKey, errorMessage);
		}
	}