!~~digit
        '0123456789'.isdigit() or 123456789
181803
def digit(nstr, schema):
    
    if isinstance(nstr, int):
        nstr = str(nstr)
    elif not isinstance(nstr, basestring):
        return False

    return nstr.isdigit()
1238544
protected int extractDigit(final char value) throws NumberFormatException {
    if (Character.isDigit(value)) {
      return Character.digit(value, DEC_RADIX);
    } else {
      throw LOG.getCharacterIsNotADigitException(value);
    }
  }
147399
function(n){

        // Examine international prefix
        if(n.substr(0,2) === '61'){
            return n.length === 11;
        }

        // Examine international prefix
        if(n.substr(0,4) === '0061'){
            return n.length === 13;
        }

        // Examine number of digits
        return n.length === 10;
    }
428362
def get_int(self):
        

        token = self.get().unescape()
        if not token.is_identifier():
            raise dns.exception.SyntaxError('expecting an identifier')
        if not token.value.isdigit():
            raise dns.exception.SyntaxError('expecting an integer')
        return int(token.value)
230204
private static int parseNumber(CharSequence offsetId, int pos, boolean precededByColon) {
        if (precededByColon && offsetId.charAt(pos - 1) != ':') {
            throw new DateTimeException("Invalid ID for ZoneOffset, colon not found when expected: " + offsetId);
        }
        char ch1 = offsetId.charAt(pos);
        char ch2 = offsetId.charAt(pos + 1);
        if (ch1 < '0' || ch1 > '9' || ch2 < '0' || ch2 > '9') {
            throw new DateTimeException("Invalid ID for ZoneOffset, non numeric characters found: " + offsetId);
        }
        return (ch1 - 48) * 10 + (ch2 - 48);
    }
644071
def t_binaryValue(t):
    '
    # We must match [0-9], and then check the validity of the binary number.
    # If we match [0-1], the invalid binary number "2b" would match
    # 'decimalValue' 2 and 'IDENTIFIER 'b'.
    if re.search(r'[2-9]', t.value) is not None:
        msg = _format("Invalid binary number {0!A}", t.value)
        t.lexer.last_msg = msg
        t.type = 'error'
        # Setting error causes the value to be automatically skipped
    else:
        t.value = int(t.value[0:-1], 2)
    return t
465213
function _numberToKey(index, totalChar, offset) {
    var sKeys = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=_!?()*',
      aArr = [],
      currentChar = index;
    totalChar = totalChar || sKeys.length;
    offset = offset || 0;
    while (currentChar >= totalChar) {
      aArr.push(sKeys.charCodeAt((currentChar % totalChar) + offset));
      currentChar = Math.floor(currentChar / totalChar - 1);
    }
    aArr.push(sKeys.charCodeAt(currentChar + offset));
    return aArr.reverse();
  }
822462
def int32(x):
    
    if x>0xFFFFFFFF:
        raise OverflowError
    if x>0x7FFFFFFF:
        x=int(0x100000000-x)
        if x<2147483648:
            return -x
        else:
            return -2147483648
    return x
1224265
def of number
      raise_on_type_mismatch number
      digits = convert_number_to_digits(number)

      sum    = digits.reverse.map.with_index do |digit, idx|
        idx.even? ? (digit * 2).divmod(10).reduce(&:+) : digit
      end.reduce(&:+)

      (10 - sum % 10) % 10
    end
1144158
private boolean matches10000( ApiDifference apiDiff )
    {
        throwIfMissing( false, false, true, true );

        int fromVersion = 0;
        int toVersion = 0;
        try
        {
            fromVersion = Integer.parseInt( from );
        }
        catch ( NumberFormatException e )
        {
            throw new IllegalArgumentException( "Failed to parse the \"from\" parameter as a number for " + this );
        }

        try
        {
            toVersion = Integer.parseInt( to );
        }
        catch ( NumberFormatException e )
        {
            throw new IllegalArgumentException( "Failed to parse the \"to\" parameter as a number for " + this );
        }

        String[] args = getArgs( apiDiff );

        int reportedOld = Integer.parseInt( args[0] );
        int reportedNew = Integer.parseInt( args[1] );

        return fromVersion == reportedOld && toVersion == reportedNew;
    }
508157
def fraction_digits(n: Literal) -> Optional[int]:
    
    # Note - the last expression below isolates the fractional portion, reverses it (e.g. 017320 --> 023710) and
    #        converts it to an integer and back to a string
    return None if not is_numeric(n) or n.value is None \
        else 0 if is_integer(n) or '.' not in str(n.value) or str(n.value).split('.')[1] == '0' \
        else len(str(int(str(n.value).split('.')[1][::-1])))
519459
def base36encode(number):
    """"""

    ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz"

    base36 = ''
    sign = ''

    if number < 0:
        sign = '-'
        number = -number

    if 0 <= number < len(ALPHABET):
        return sign + ALPHABET[number]

    while number != 0:
        number, i = divmod(number, len(ALPHABET))
        base36 = ALPHABET[i] + base36

    return sign + base36
929158
def try_fix_num(n):
    
    if not n.isdigit():
        return n
    if n.startswith("0"):
        n = n.lstrip("0")
    if not n:
        n = "0"
    return int(n)
761118
private static int indexOfNonDigit(String string, int offset) {
        for (int i = offset; i < string.length(); i++) {
            char c = string.charAt(i);
            if (c < '0' || c > '9') return i;
        }
        return string.length();
    }
1346342
function mkId(value, mayBeNegative) {
            var id = -1,
                sign = 1;
            if (value.charAt(0) == '-') {
                sign = -1;
                value = value.substring(1);
            }
            if (Lang.NUMBER_DEC.test(value))
                id = parseInt(value);
            else if (Lang.NUMBER_HEX.test(value))
                id = parseInt(value.substring(2), 16);
            else if (Lang.NUMBER_OCT.test(value))
                id = parseInt(value.substring(1), 8);
            else
                throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value);
            id = (sign*id)|0; // Force to 32bit
            if (!mayBeNegative && id < 0)
                throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value);
            return id;
        }
986711
def total_digits(n: Literal) -> Optional[int]:
    
    return len(str(abs(int(n.value)))) + fraction_digits(n) if is_numeric(n) and n.value is not None else None
570878
private int skipDigits() {
        char ch;
        int i = 0;

        while (index < format.length()) {
            if (Character.isDigit(ch = format.charAt(index))) {
                index++;
                i = i * 10 + Character.digit(ch, 10);
            } else {
                break;
            }
        }
        return i;
    }