Checks the number valiaty for the Espirito Santo state
484114
def start(st_reg_number):
    """"""

    weights = [9, 8, 7, 6, 5, 4, 3, 2]
    number_state_registration = st_reg_number[0:len(st_reg_number) - 1]
    digit_state_registration = st_reg_number[-1]

    if st_reg_number[0:2] not in ['10', '11', '12']:
        return False

    if len(st_reg_number) != 9:
        return False

    sum_total = 0

    for i in weights:
        sum_total = sum_total + i * (int(number_state_registration[-i+1]))

    check_number = number_state_registration <= 10119997

    if sum_total % 11 == 0:
        return '0' == digit_state_registration

    elif sum_total % 11 == 1 and (int(number_state_registration) >= 10103105 and check_number):
        return '1' == digit_state_registration

    elif sum_total % 11 == 1:
        return '0' == digit_state_registration

    else:
        digit_check = 11 - sum_total % 11
        return digit_state_registration == str(digit_check)

    if number_state_registration == '11094402' and (number_state_registration == '1' or number_state_registration == '0'):
        return True
1232193
private boolean checkPlTaxNumber(final String ptaxNumber) {
    final int checkSum = ptaxNumber.charAt(ptaxNumber.length() - 1) - '0';
    int calculatedCheckSum;
    if (StringUtils.length(ptaxNumber) == 11) {
      // PESEL
      final int sum = (ptaxNumber.charAt(0) - '0') * 1 //
          + (ptaxNumber.charAt(1) - '0') * 3 //
          + (ptaxNumber.charAt(2) - '0') * 7 //
          + (ptaxNumber.charAt(3) - '0') * 9 //
          + (ptaxNumber.charAt(4) - '0') * 1 //
          + (ptaxNumber.charAt(5) - '0') * 3 //
          + (ptaxNumber.charAt(6) - '0') * 7 //
          + (ptaxNumber.charAt(7) - '0') * 9 //
          + (ptaxNumber.charAt(8) - '0') * 1 //
          + (ptaxNumber.charAt(9) - '0') * 3;
      calculatedCheckSum = sum % 10;
      if (calculatedCheckSum != 0) {
        calculatedCheckSum = 10 - sum % 10;
      }
    } else {
      // NIP
      final int sum = (ptaxNumber.charAt(0) - '0') * 6 //
          + (ptaxNumber.charAt(1) - '0') * 5 //
          + (ptaxNumber.charAt(2) - '0') * 7 //
          + (ptaxNumber.charAt(3) - '0') * 2 //
          + (ptaxNumber.charAt(4) - '0') * 3 //
          + (ptaxNumber.charAt(5) - '0') * 4 //
          + (ptaxNumber.charAt(6) - '0') * 5 //
          + (ptaxNumber.charAt(7) - '0') * 6 //
          + (ptaxNumber.charAt(8) - '0') * 7;
      calculatedCheckSum = sum % MODULO_11;
    }
    return checkSum == calculatedCheckSum;
  }
1301595
private function validateOld(string $vatNumber): string
    {
        $checkval = substr($vatNumber, 2);
        $checkval .= "12";
        $checkval = intval($checkval) % 97;

        return $checkval == 0 ? "00" : (string) $checkval;
    }
1060160
function validateNum() {
        var pass = true,
        num = '';

        ['#areacode', '#phnum1', '#phnum2'].forEach(function(id) {
            var $e = $(id),
            val = $e.val();

            if(!val || val.length !== parseInt($e.attr('maxlength'), 10)) {
                pass = false;
                $e.addClass('error');
            }
            else
                num += val;
        });

        if(!pass) return false;

        return num;
    }
951639
public static function state($state) {

        $result = new \sb\Validate\Results();
        $result->value = $state;

        if (in_array($state, self::states)) {

            $result->is_valid = true;
            $result->message = 'Valid state code';
        } else {

            $result->is_valid = false;
            $result->message = 'Invalid state code, are you sure you are using a two letter abbreviation';
        }

        return $result;
    }
25498
def start(st_reg_number):
        """"""
        weights = range(2, 10)
        digits = st_reg_number[0:len(st_reg_number) - 1]
        control_digit = 11
        check_digit = st_reg_number[-1:]

        if len(st_reg_number) != 9:
                return False

        sum_total = 0

        for i in weights:
                sum_total = sum_total + i * int(digits[i-2])

        if sum_total < control_digit:
                control_digit = 11 - sum_total
                return str(digit_calculated) == check_digit

        elif sum_total % 11 <= 1:
                return '0' == check_digit

        else:
                digit_calculated = 11 - sum_total % 11
                return str(digit_calculated) == check_digit
372609
private function validateNumber(): bool
    {
        if ($this->options['require-number'] === true) {
            if (!\preg_match('/[0-9]/', (string)$this->value)) {
                $this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_NUMBER);
                return false;
            }
        }
        return true;
    }
572081
def _is_number_matching_desc(national_number, number_desc):
    """"""
    # Check if any possible number lengths are present; if so, we use them to avoid checking the
    # validation pattern if they don't match. If they are absent, this means they match the general
    # description, which we have already checked before checking a specific number type.
    if number_desc is None:
        return False
    actual_length = len(national_number)
    possible_lengths = number_desc.possible_length
    if len(possible_lengths) > 0 and actual_length not in possible_lengths:
        return False
    return _match_national_number(national_number, number_desc, False)
245254
public function numbersBuy ($country_code, $msisdn) {
			$country_code = strtoupper($country_code);

			$tmp = $this->apiCall('buy_number', array('country_code'=>$country_code, 'msisdn'=>$msisdn));
			return ($tmp['http_code'] === 200);
		}
317668
function isValid(number, countryCode) {
    try {
        var phoneUtil = i18n.phonenumbers.PhoneNumberUtil.getInstance();
        var numberObj = phoneUtil.parseAndKeepRawInput(number, countryCode);
        return phoneUtil.isValidNumber(numberObj);
    } catch (e) {
        return false;
    }
}
1039098
public function incTry(IState &$state = null): int
    {
        $count = (int) $state->getAdditional(static::STATE__CURRENT_TRIES_COUNT);
        $count++;
        $state->setAdditional(static::STATE__CURRENT_TRIES_COUNT, $count);

        return $count;
    }
473646
public function numbersCancel ($country_code, $msisdn) {
			$country_code = strtoupper($country_code);

			$tmp = $this->apiCall('cancel_number', array('country_code'=>$country_code, 'msisdn'=>$msisdn));
			return ($tmp['http_code'] === 200);
		}
563191
public function isChsAlphaNum() {
        $this->check_role = 'chsAlphaNum';
        $result = $this->checkRegex($this->value, '/^[\x{4e00}-\x{9fa5}a-zA-Z0-9]+$/u');
        $this->checkResult($result);
        return $this;
    }
48326
function internalNumber( $number )
    {
        if ( preg_match( '/^(['.$this->PositiveSymbol.']|['.$this->NegativeSymbol.'])?([0-9]*|[0-9]{1,3}(['.$this->ThousandsSeparator.'][0-9]{3,3})*)(['.$this->DecimalSymbol.'][0-9]+)?$/', trim( $number ) ) )
        {
            $number = str_replace( ' ', '', $number );
            if ( $this->PositiveSymbol )
                $number = str_replace( $this->PositiveSymbol, '', $number );
            $number = str_replace( $this->NegativeSymbol, '-', $number );
            $number = str_replace( $this->ThousandsSeparator, '', $number );
            $number = str_replace( $this->DecimalSymbol, '.', $number );
        }
        return $number;
    }
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;
    }
232361
private function json_validate_zipcode() 
    {
        if (!empty($this->valueJson) && is_string($this->valueJson))
        {
            $ret = @json_decode($this->valueJson, true);            
            return (json_last_error() === JSON_ERROR_NONE && 
                    isset($ret['cep']) &&
                    isset($ret['logradouro']) &&
                    isset($ret['complemento']) &&
                    isset($ret['bairro']) &&
                    isset($ret['localidade']) &&
                    isset($ret['uf']) &&
                    isset($ret['ibge']) &&
                    isset($ret['gia'])) &&
                    isset($ret['unidade']);
        }
        return false;
    }
1045237
def ConsultarDetalleCTG(self, numero_ctg=None):
        ""
        ret = self.client.consultarDetalleCTG(request=dict(
                        auth={
                            'token': self.Token, 'sign': self.Sign,
                            'cuitRepresentado': self.Cuit, },
                        ctg=numero_ctg, 
                        ))['response']
        self.__analizar_errores(ret)
        datos = ret.get('consultarDetalleCTGDatos')
        if datos:
            self.NumeroCTG = str(datos['ctg'])
            self.CartaPorte = str(datos['cartaPorte'])
            self.Estado = unicode(datos['estado'])
            self.FechaHora = str(datos['fechaEmision'])
            self.VigenciaDesde = str(datos['fechaVigenciaDesde'])
            self.VigenciaHasta = str(datos['fechaVigenciaHasta'])
            self.TarifaReferencia = str(datos['tarifaReferencia'])
            self.Detalle = str(datos.get('detalle', ""))
        return True