Consume a token from plannedTokens.
2367
function (stream, state) {
        var plannedToken = state.plannedTokens.shift();
        if (plannedToken === undefined) {
            return null;
        }
        stream.match(plannedToken.value);
        var tokens = plannedToken.type.split('.');
        return cmTokenFromAceTokens(tokens);
    }
437414
def process_tokens(self, tokens):
        
        """
        for (tok_type, token, (start_row, _), _, _) in tokens:
            if tok_type == tokenize.STRING:
                self._check_string(token, start_row)
1292260
public ParserToken consume(@NonNull ParserTokenType expectedType) throws ParseException {
      ParserToken next = consume();
      if (next == null || !expectedType.isInstance(next.type)) {
         throw new ParseException("Expected the next token to be of type " + expectedType + ", but found " + (next == null
                                                                                                              ? null
                                                                                                              : next.type));
      }
      return next;
   }
680435
def _consume(iterator, n=None):
    """"""
    # Use functions that consume iterators at C speed.
    if n is None:
        # feed the entire iterator into a zero-length deque
        collections.deque(iterator, maxlen=0)
    else:
        # advance to the empty slice starting at position n
        next(itertools.islice(iterator, n, n), None)
595705
private JsDocToken eatTokensUntilEOL(JsDocToken token) {
    do {
      if (token == JsDocToken.EOL || token == JsDocToken.EOC ||
          token == JsDocToken.EOF) {
        state = State.SEARCHING_ANNOTATION;
        return token;
      }
      token = next();
    } while (true);
  }
853658
def consume_simple_block(input = @tokens)
      start_token = input.current[:node]
      end_token   = BLOCK_END_TOKENS[start_token]

      block = {
        :start  => start_token.to_s,
        :end    => end_token.to_s,
        :value  => [],
        :tokens => [input.current] # Non-standard. Used for serialization.
      }

      block[:tokens].concat(input.collect do
        while token = input.consume
          break if token[:node] == end_token

          input.reconsume
          block[:value] << consume_component_value(input)
        end
      end)

      create_node(:simple_block, block)
    end
1190782
function getPaymentByNotificationToken(token, callback) {
    var client = new this.clients.Payments();
    client.getByNotificationToken(token, callback);
  }
386788
def consume_comments
      if @s.peek(2) == '/*'
        @s.consume
        @s.consume

        if text = @s.scan_until(RE_COMMENT_CLOSE)
          text.slice!(-2, 2)
        else
          # Parse error.
          text = @s.consume_rest
        end

        return create_token(:comment, :value => text)
      end

      nil
    end
891575
def _consume_python_token(self, token):
        
        ret = []
        line, col = token[3]
        if line > 1:
            ret = self._buffer[:line-1]
            self._buffer[:line-1] = []
        ret.append(self._buffer[0][:col])
        self._buffer[0] = self._buffer[0][col:]
        return ''.join(ret)
1053497
def _parse_next_token(self):
        """"""
        while self._position < self.limit:
            token = self._next_pattern()
            if token:
                return token

        return None
648321
def consume(self, msg):
        
        msg['body'] = crypto.sign(msg['body'], **self.hub.config)
        super(SigningRelayConsumer, self).consume(msg)
724211
protected final Token consumeToken(Symbol expected) throws ScanException, ParseException {
		if (token.getSymbol() != expected) {
			fail(expected);
		}
		return consumeToken();
	}
700334
def data_received(self, data):
        """"""
        self.tokenizer.feed(data)
        while self.tokenizer.has_tokens():
            raw = self.tokenizer.get_next_token()
            frame = frame_from_raw(raw)
            if frame is not None:
                self.frame_received_cb(frame)
398055
public void consumeUntil(Parser recognizer, IntervalSet follow, CSSLexerState.RecoveryMode mode, CSSLexerState ls) {
        CSSToken t;
        boolean finish;
        TokenStream input = recognizer.getInputStream();
        do {
            Token next = input.LT(1);
            if (next instanceof CSSToken) {
                t = (CSSToken) input.LT(1);
                if (t.getType() == Token.EOF) {
                    logger.trace("token eof ");
                    break;
                }
            } else
                break; /* not a CSSToken, probably EOF */
            // consume token if does not match
            finish = (t.getLexerState().isBalanced(mode, ls, t) && follow.contains(t.getType()));
            if (!finish) {
                logger.trace("Skipped: {}", t);
                input.consume();
            }
        } while (!finish);
    }
1250108
def consume(self, no_ack=None):
        """"""
        no_ack = no_ack or self.no_ack
        self.backend.declare_consumer(queue=self.queue, no_ack=no_ack,
                                      callback=self._receive_callback,
                                      consumer_tag=self.consumer_tag,
                                      nowait=True)
        self.channel_open = True
250822
def set_token(self, token):
        

        if not token:
            self.token = None
            return

        expected_keys = ['token_type', 'refresh_token', 'access_token', 'scope', 'expires_in', 'expires_at']
        if not isinstance(token, dict) or not set(token) >= set(expected_keys):
            raise InvalidUsage("Expected a token dictionary containing the following keys: {0}"
                               .format(expected_keys))

        # Set sanitized token
        self.token = dict((k, v) for k, v in token.items() if k in expected_keys)
292804
function slice(toToken) {
    if (has(toToken) && !isLast(toToken)) {
        _tokens = _tokens.slice(0, _tokens.lastIndexOf(toToken) + 1);
    }
}