Performs checks on the input token. Raises an exception if unsupported.

        :param token: the token to check
        :type token: Token
973104
def check_input(self, token):
        
        if token is None:
            raise Exception(self.full_name + ": No token provided!")
        if isinstance(token.payload, str):
            return
        raise Exception(self.full_name + ": Unhandled class: " + classes.get_classname(token.payload))
884814
function isChecked(token) {
    var checked = false;

    if (token.content.indexOf('[x]') === 0 || token.content.indexOf('[X]') === 0) {
        checked = true;
    }

    return checked;
}
1198479
private function _checkProhibitedTokens($token) {
		if ($this->_isActive('checkProhibitedTokens')) {
			if (in_array($token->getName(), $this->_prohibitedTokens)) {
				$msg = $this->_getMessage("PROHIBITED_TOKEN", $token->getName());
				$this->_writeError('checkProhibitedTokens', $msg);
			}
		}
	}
340856
def check_unique_tokens(sender, instance, **kwargs):
    
    if isinstance(instance, CallbackToken):
        if CallbackToken.objects.filter(key=instance.key, is_active=True).exists():
            instance.key = generate_numeric_token()
1298425
public boolean isExceptionMatched(AnalyzedToken token) {
    if (exceptionSet) {
      for (PatternToken testException : exceptionList) {
        if (!testException.exceptionValidNext) {
          if (testException.isMatched(token)) {
            return true;
          }
        }
      }
    }
    return false;
  }
97004
def check_token(self, user, token):
        
        # Parse the token
        try:
            ts_b36, hash = token.split("-")
        except ValueError:
            return False

        try:
            ts = base36_to_int(ts_b36)
        except ValueError:
            return False

        # Check that the timestamp/uid has not been tampered with
        if not constant_time_compare(self._make_token_with_timestamp(user, ts), token):
            return False

        # Check the timestamp is within limit
        if (self._num_days(self._today()) - ts) > REGISTRATION_TIMEOUT_DAYS:
            return False

        return True
166449
def peekuntil(self, token, size=0):
        
        self.__append()

        i = self.buf.find(token, self.pos)
        if i < 0:
            index = max(len(token) - 1, size)
            newpos = max(len(self.buf) - index, self.pos)
            return False, self.buf[self.pos:newpos]

        newpos = i + len(token)
        return True, self.buf[self.pos:newpos]
2124
public void assertToken(final int token) throws ParseException {
    try {
      if (nextToken() != token) {
        throw new ParseException("Expected [" + token + "], read [" +
                                  ttype + "] at " + lineno());
      }

      if (debug()) {
        if (token > 0) {
          debug("[" + (char)token + "]");
        } else {
          debug("[" + token + "]");
        }
      }
    } catch (IOException e) {
      throw new ParseException(e);
    }
  }
1317163
def check(self, request, consumer, token, signature):
        
        built = self.sign(request, consumer, token)
        if isinstance(signature, STRING_TYPES):
            signature = signature.encode("utf8")
        return built == signature
314574
def check_token(self, token=None):
        
        if token is None:
            token = self.token
        resp, resp_body = self.method_head("tokens/%s" % token, admin=True)
        if resp.status_code in (401, 403):
            raise exc.AuthorizationFailure("You must be an admin to make this "
                    "call.")
        return 200 <= resp.status_code < 300
968734
def valid_token(token):
    
    is_scale = False

    # Check if the token represents a scale
    # If it doesn't set a flag accordingly
    try:
        Scale(token)
        is_scale = True
    except ScaleFormatError:
        pass

    # If token either represents a numerical value, a
    # separator token, or a scale, it is considered valid
    if any([token.isdigit(), token in SEPARATOR_TOKENS, is_scale]):
        return True

    return False
57163
def valid(cls, token, **kwargs):
        
        try:
            token = yield cls.get(token)
        except couch.NotFound:
            raise Return(False)

        raise Return(token.ttl >= datetime.utcnow())
290697
def _expect_token(self, expected):
        

        item = self._lexer.get_token()

        if not item:
            raise ParseError(u'Unexpected end of file')

        else:
            line_no, token = item

        if token != expected:
            raise ParseError(u"Unexpected token '{0}', "
                             u"expecting '{1}' on line {2}"
                             .format(common.from_utf8(token.strip()), expected,
                                     line_no))
1161857
private int assertToken(final StreamTokenizer tokeniser, Reader in, final String token)
            throws IOException, ParserException {
        return assertToken(tokeniser, in, token, false, false);
    }
147442
public void addToken(Token token)
    {
        // Add verification of no token overlap
        if (!token.getSentence().equals(this))
            throw new IllegalArgumentException();
        tokens.add(token);
    }
680230
def _verify_token(self):
        
        res = self._session.get(self._token_verification_url)
        if not res.ok:
            raise exceptions.BadToken(consts.LOG_MSG_BAD_TOKEN)
        return True
988809
def verify_token(self, token):
        '''
        
        '''
        try:
            result = self.resolver.get_token(token)
        except Exception as ex:
            raise EauthAuthenticationError(
                "Token validation failed with {0}.".format(repr(ex)))

        return result