Tests for plausibility of this national number.
502910
def plausible? rest, hints = {}
      local, _, ndc, *rest = internal_split rest

      # Element based checking.
      #
      # Note: ndc == false means the country has none.
      #
      return false if ndc.nil?
      return false if ndc && ndc.empty?
      return false if @invalid_ndcs && @invalid_ndcs === ndc

      # # A valid range for the rest is 0 or 3+ total digits.
      # #
      # return false if (1..2) === rest_size

      # National destination code plausible?
      #
      ndc_needed = hints[:ndc]
      return false if ndc_needed && !(ndc_needed === ndc)
      
      # If there is no local part, we can assume it's not a plausible number.
      # (Or, not defined correctly in Phony yet)
      return false unless local

      # Local code specific checks.
      #
      return local.plausible? rest, hints
    end
1255006
def _is_number_match_SS(number1, number2):
    
    try:
        numobj1 = parse(number1, UNKNOWN_REGION)
        return _is_number_match_OS(numobj1, number2)
    except NumberParseException:
        _, exc, _ = sys.exc_info()
        if exc.error_type == NumberParseException.INVALID_COUNTRY_CODE:
            try:
                numobj2 = parse(number2, UNKNOWN_REGION)
                return _is_number_match_OS(numobj2, number1)
            except NumberParseException:
                _, exc2, _ = sys.exc_info()
                if exc2.error_type == NumberParseException.INVALID_COUNTRY_CODE:
                    try:
                        numobj1 = parse(number1, None, keep_raw_input=False,
                                        _check_region=False, numobj=None)
                        numobj2 = parse(number2, None, keep_raw_input=False,
                                        _check_region=False, numobj=None)
                        return _is_number_match_OO(numobj1, numobj2)
                    except NumberParseException:
                        return MatchType.NOT_A_NUMBER

    # One or more of the phone numbers we are trying to match is not a viable
    # phone number.
    return MatchType.NOT_A_NUMBER
772306
def is30(msg):
    

    if allzeros(msg):
        return False

    d = hex2bin(data(msg))

    if d[0:8] != '00110000':
        return False

    # threat type 3 not assigned
    if d[28:30] == '11':
        return False

    # reserved for ACAS III, in far future
    if bin2int(d[15:22]) >= 48:
        return False

    return True
493986
private function isNumeric()
    {
        foreach (array_keys($this->options) as $key) {
            if (!is_int($key)) {
                return false;
            }
        }

        return true;
    }
173816
def plausible? number, hints = {}
      normalized = clean number

      # False if it fails the basic check.
      #
      return false unless (4..16) === normalized.size

      country, cc, rest = partial_split normalized

      # Country code plausible?
      #
      cc_needed = hints[:cc]
      return false if cc_needed && !(cc_needed === cc)

      # Country specific tests.
      #
      country.plausible? rest, hints
    rescue StandardError
      return false
    end
1105995
function(n){

    	if(!_.isNumber(n)){
            return;
	    }

        // Avoid stepping over
        if(this._data[this._itr + n] === undefined){
            return;
        }

        // Advance num steps
        this._itr += n;
    }
1338478
private function isNanpaNumberWithNationalPrefix()
    {
        // For NANPA numbers beginning with 1[2-9], treat the 1 as the national prefix. The reason is
        // that national significant numbers in NANPA always start with [2-9] after the national prefix.
        // Numbers beginning with 1[01] can only be short/emergency numbers, which don't need the
        // national prefix.
        return ($this->currentMetadata->getCountryCode() == 1) && (mb_substr($this->nationalNumber, 0, 1) == '1')
            && (mb_substr($this->nationalNumber, 1, 1) != '0') && (mb_substr($this->nationalNumber, 1, 1) != '1');
    }
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:]))
1320718
function(num) {
            if(typeof num !== "number") {
                return NaN;
            }
            var isNegative = (num < 0),
                result;

            if(isNegative) {
                num = -num;
            }
            if(num < 10) {
                num += (10 - num) / 10;
            }
            result = this.logBaseTen(num);
            return (isNegative) ? -result : result;
        }
500159
def validate(self, tracking_number):
        ""
        tracking_num = tracking_number[2:-1]
        odd_total = 0
        even_total = 0

        for ii, digit in enumerate(tracking_num.upper()):
            try:
                value = int(digit)
            except ValueError:
                value = int((ord(digit) - 63) % 10)
            if (ii + 1) % 2:
                odd_total += value
            else:
                even_total += value

        total = odd_total + even_total * 2
        check = ((total - (total % 10) + 10) - total) % 10
        return (check == int(tracking_number[-1:]))
959211
def check_candidate(a, d, n, s):
    """"""
    if pow(a, d, n) == 1:
        return False
    for i in range(s):
        if pow(a, 2 ** i * d, n) == n - 1:
            return False
    return True
687647
function computeFactorial(number) {
    number = Number(number);
    if (!(_regex.regex.positiveInteger.test(String(number)) || number === 0)) {
        throw new Error("number should be 0 or positiveNumber but got " + number);
    }
    if (number === 0) {
        return 1;
    }
    var result = 1;
    for (var i = 2; i <= number; i++) {
        result *= i;
    }
    return result;
}
1349830
private boolean rule3(double sample) {
        if (null == rule3PreviousSample) {
            rule3PreviousSample = sample;
            rule3Count = 0;
            return false;
        }

        if (sample > rule3PreviousSample) {
            if (rule3Count > 0) {
                ++rule3Count;
            } else {
                rule3Count = 1;
            }
        } else if (sample < rule3PreviousSample) {
            if (rule3Count < 0) {
                --rule3Count;
            } else {
                rule3Count = -1;
            }
        } else {
            rule3Count = 0;
        }

        rule3PreviousSample = sample;

        return Math.abs(rule3Count) >= 6;
    }
389491
function(value){
      return _.isNumber(value) || (_.isString(value) && value.match(defaultPatterns.number));
    }
1048713
function ParseNationalNumber(number, md) {
    if (!md.possiblePattern.test(number) ||
        !md.nationalPattern.test(number)) {
      return null;
    }
    // Success.
    return new NationalNumber(md, number);
  }
395567
def start(st_reg_number):
    """"""
    divisor = 11

    if len(st_reg_number) > 9:
        return False

    if len(st_reg_number) < 9:
        return False

    sum_total = 0
    peso = 8
    for i in range(len(st_reg_number)-2):
        sum_total = sum_total + int(st_reg_number[i]) * peso
        peso = peso - 1

        rest_division = sum_total % divisor
        digit_first = divisor - rest_division

    if rest_division < 2:
        digit_first = 0

    if rest_division > 1:
        digit_first = 11 - rest_division

    num = 0
    peso = 9
    mult = 10000000
    for i in range(len(st_reg_number)-2):
        num = num + int(st_reg_number[i]) * mult
        mult = mult/10

    num = num + digit_first

    new_st = str(num)
    sum_total = 0
    peso = 9
    for i in range(len(new_st)-1):
        sum_total = sum_total + int(new_st[i]) * peso
        peso = peso - 1

    rest_division = sum_total % divisor

    if rest_division < 2:
        digit_secund = 0

    if rest_division > 1:
        digit_secund = divisor - rest_division

    if digit_secund == int(st_reg_number[len(st_reg_number)-1]) and digit_first == int(st_reg_number[len(st_reg_number)-2]):
        return True
    else:
        return False
567007
def is_valid_nhs_number(n: int) -> bool:
      # noqa
    if not isinstance(n, int):
        log.debug("is_valid_nhs_number: parameter was not of integer type")
        return False

    s = str(n)
    # Not 10 digits long?
    if len(s) != 10:
        log.debug("is_valid_nhs_number: not 10 digits")
        return False

    main_digits = [int(s[i]) for i in range(9)]
    actual_check_digit = int(s[9])  # tenth digit
    expected_check_digit = nhs_check_digit(main_digits)
    if expected_check_digit == 10:
        log.debug("is_valid_nhs_number: calculated check digit invalid")
        return False
    if expected_check_digit != actual_check_digit:
        log.debug("is_valid_nhs_number: check digit mismatch")
        return False
    # Hooray!
    return True