Tells if the given digit is part of this numeral system.
@param mixed $digit The digit to look up
@return bool True if the digit exists, false is not
500982
public function hasDigit($digit)
    {
        try {
            $this->digits->getValue($digit);
        } catch (DigitList\InvalidDigitException $ex) {
            return false;
        }

        return true;
    }
392043
protected function _checkdigitAlg1($partNumber, $value) {
		$symbolsFlipped = array_flip($this->_symbols);
		$result = $partNumber;

		foreach (str_split($value) as $char) {
			$result = $result * 19 + $symbolsFlipped[$char];
		}
		return $this->_symbols[$result % (count($this->_symbols) - 1)];
	}
1193963
public function isValid($value)
    {
        $valueString = (string) $value;

        $this->_setValue($valueString);

        if ('' === $valueString) {
            $this->_error(self::STRING_EMPTY);
            return false;
        }

        if (null === self::$_filter) {
            /**
             * @see Zend_Filter_Digits
             */
            require_once 'Zend/Filter/Digits.php';
            self::$_filter = new Zend_Filter_Digits();
        }

        if ($valueString !== self::$_filter->filter($valueString)) {
            $this->_error(self::NOT_DIGITS);
            return false;
        }

        return true;
    }
506291
public static function withCheckDigitForEan($ean)
    {
        // Sanitize
        $ean = (int) $ean;
        $ean = substr($ean, 0, 12);

        // Validate
        if (strlen($ean) != 12) {
            return null;
        }

        // Calculate (sum)
        $sum = 0;
        for ($i = 0; $i < 12; $i++) {
            $sum += $ean{$i} * ($i % 2 ? 3 : 1);
        }

        // Calculate (check digit)
        $checkDigit = ceil($sum / 10) * 10 - $sum;

        return $ean . $checkDigit;
    }
448829
public function isPage(int $number): bool
    {
        return (in_array($number, $this->pages)) ? true : false;
    }
976773
public function isNumeric(): bool
    {
        if ($this->isEmpty()) {
            return false;
        }

        foreach ($this->keys()->getGenerator() as $key) {
            if (!\is_int($key)) {
                return false;
            }
        }

        return true;
    }
1021367
public static function isValidDni(string $dni): bool
    {
        if (!preg_match(self::DNI_REGEX, $dni, $matches)) {
            return false;
        }
        if ('00000000' === $matches['number']) {
            return false;
        }

        return self::DNINIE_CHECK_TABLE[$matches['number'] % 23] === $matches['check'];
    }
1188952
protected function evaluateInput($digit)
    {
        if ($this->inputIsCancel($digit)) {
            return self::INPUT_CANCEL;
        }
        if ($this->inputIsEnd($digit)) {
            return self::INPUT_END;
        }
        return self::INPUT_NORMAL;
    }
476063
public static function is($value)
    {
        return (is_int($value) || (is_numeric($value) && !is_float($value) && !Str::contains($value, '.')));
    }
685416
public function isSameAs(Token $token)
    {
        $hasNumberWildcard = ($this->hasNumber() && $token->hasNumber());
        if ($hasNumberWildcard && $this->number !== $token->number) {
            return false;
        }
        $hasValueWildcard = ($this->hasValue() && $token->hasValue());
        if ($hasValueWildcard && $this->value !== $token->value) {
            return false;
        }
        $hasLineNumberWildcard = ($this->hasLineNumber() && $token->hasLineNumber());
        if ($hasLineNumberWildcard && $this->lineNumber !== $token->lineNumber) {
            return false;
        }

        return true;
    }
364543
def digit():
    ''''''
    @Parser
    def digit_parser(text, index=0):
        if index < len(text) and text[index].isdigit():
            return Value.success(index + 1, text[index])
        else:
            return Value.failure(index, 'a digit')
    return digit_parser
93682
public function isSuperUser()
    {
        $result = null;
        if ($result === null && $this->functionInspector->functionAvailable('posix_getuid')) {
            $uid = posix_getuid();
            if (is_int($uid)) {
                $result = $uid === 0;
            }
        }

        return $result;
    }
1123707
public function isSameValueAs(Fraction $fraction)
    {
        if ($this->getNumerator() != $fraction->getNumerator()) {
            return false;
        }

        if ($this->getDenominator() != $fraction->getDenominator()) {
            return false;
        }

        return true;
    }
862430
public function getDecimalIsHalf( $scale = false )
	{
		if ( ! $this->getIsDecimal() ) {
			return false;
		}

		if ( $scale === false ) $scale = $this->scale( $this->_value );
		if ( $scale < 0 ) $scale = $scale = 0;

		$decimalPart = $this->getDecimalPart();
		if ( $scale >= strlen( $decimalPart ) ) return false;

		// Get the portion of the decimal part affected by the scale value
		$decimalPart = substr( $decimalPart, $scale );
		return strlen( $decimalPart ) == 1 && $decimalPart == "5";
	}
531676
def is_digit(obj):
    '''
    
    '''
    return isinstance(obj, (numbers.Integral, numbers.Complex, numbers.Real))
358113
public function validate($input)
    {
        $checkDigit = explode(',', '0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,h,j,k,l,m,n,p,r,s,t,u,v,w,x,y');

        // Get the check digit
        $check = strtolower(substr($input, -1, 1));

        // Remove dash, plus or A
        if (strlen($input) == 11) {
            $input = substr($input, 0, 6) . substr($input, 7, 3);
        } else {
            $input = substr($input, 0, 9);
        }

        if (!preg_match('/^\d+$/', $input)) {
            return false;
        }

        // Do the math
        $result = $input % 31;

        return $checkDigit[$result] == $check;
    }
618496
protected function keyExistsByFingerprint($fingerprint)
    {
        foreach ($this->api()->getClient()->getSshKeys() as $existingKey) {
            if ($existingKey->fingerprint === $fingerprint) {
                return true;
            }
        }

        return false;
    }