Peeks for token into the FIFO.

        Performs the same function as readuntil() without removing data from the
        FIFO. See readuntil() for further information.
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]
202390
@Override
    public T peek() {
        synchronized (this) {
            if (numberOfUsedExpeditedSlots.get() > 0) {
                return expeditedBuffer[expeditedTakeIndex];
            } else if (numberOfUsedSlots.get() > 0) {
                return buffer[takeIndex];
            } else {
                return null;
            }
        }
    }
483676
@Override
    public ReaderT<W,T,R> peek(final Consumer<? super R> peek) {
        return of(run.peek(reader -> reader.mapFn(a -> {
            peek.accept(a);
            return a;
        })));
    }
377072
def start_readout(self, *args, **kwargs):
        ''' 
        '''
        # Pop parameters for fifo_readout.start
        callback = kwargs.pop('callback', self.handle_data)
        errback = kwargs.pop('errback', self.handle_err)
        reset_rx = kwargs.pop('reset_rx', True)
        reset_fifo = kwargs.pop('reset_fifo', True)
        fill_buffer = kwargs.pop('fill_buffer', False)
        no_data_timeout = kwargs.pop('no_data_timeout', None)
        enabled_fe_channels = kwargs.pop('enabled_fe_channels', self._enabled_fe_channels)
        if args or kwargs:
            self.set_scan_parameters(*args, **kwargs)
        if self._scan_threads and self.current_module_handle not in [t.name for t in self._scan_threads]:
            raise RuntimeError('Thread name "%s" is not valid.' % t.name)
        if self._scan_threads and self.current_module_handle in self._curr_readout_threads:
            raise RuntimeError('Thread "%s" is already actively reading FIFO.')
        with self._readout_lock:
            self._curr_readout_threads.append(self.current_module_handle)
        self._starting_readout_event.clear()
        while not self._starting_readout_event.wait(0.01):
            if self.abort_run.is_set():
                break
            with self._readout_lock:
                if len(set(self._curr_readout_threads) & set([t.name for t in self._scan_threads if t.is_alive()])) == len(set([t.name for t in self._scan_threads if t.is_alive()])) or not self._scan_threads:
                    if not self.fifo_readout.is_running:
                        self.fifo_readout.start(fifos=self._selected_fifos, callback=callback, errback=errback, reset_rx=reset_rx, reset_fifo=reset_fifo, fill_buffer=fill_buffer, no_data_timeout=no_data_timeout, filter_func=self._filter, converter_func=self._converter, fifo_select=self._readout_fifos, enabled_fe_channels=enabled_fe_channels)
                        self._starting_readout_event.set()
616438
private boolean processTrueOrFalse() {

        if (token.tokenType == Tokens.TRUE) {
            read();

            return true;
        } else if (token.tokenType == Tokens.FALSE) {
            read();

            return false;
        } else {
            throw unexpectedToken();
        }
    }
285017
function(inputIndex) {

            _.each(tokens, function(token, index) {
                // determain whether or not this is a file reference or a string
                if(token.file) {

                    // read the file and reset replacement to what was loaded
                    fs.readFile(token.file, 'utf8', function(e, data) {
                        if(e) {
                            grunt.fail.warn("There was an error processing the replacement '" + token.file + "' file.");
                        }
                        tokens[index].contents = data;
                        processTokenCompleteCallback();
                    });

                } else if(token.string) {
                    // we didn't need to load a file
                    tokens[index].contents = token.string;
                    processTokenCompleteCallback();
                } else {
                    processTokenCompleteCallback();
                }

            }, this);
        }
151065
private void scanTwoDigitSpecial() {

        if (mInput == '=' && (mType == TokenType.COMP || mType == TokenType.EQ || mType == TokenType.N_EQ)) {
            mOutput.append(mInput);
            mPos++;
        } else if (mInput == '/' && (mType == TokenType.SLASH)) {
            mOutput.append(mInput);
            mType = TokenType.DESC_STEP;
            mPos++;
        } else if (mInput == '.' && (mType == TokenType.POINT)) {
            mOutput.append(mInput);
            mType = TokenType.PARENT;
            mPos++;
        } else if (mInput == '<' && mOutput.toString().equals("<")) {
            mOutput.append(mInput);
            mType = TokenType.L_SHIFT;
            mPos++;
        } else if (mInput == '>' && mOutput.toString().equals(">")) {
            mOutput.append(mInput);
            mType = TokenType.R_SHIFT;
            mPos++;
        } else if (mInput == ':' && mType == TokenType.OPEN_BR) {
            // could be start of a comment
            mOutput = new StringBuilder();
            mType = TokenType.COMMENT;
            mCommentCount++;
            mState = State.COMMENT;
            mPos++;
        } else {
            mFinnished = true;
        }
    }
180178
def _peek(tokens, n=0):
    """"""
    return tokens.peek(n=n, skip=_is_comment, drop=True)
1225015
function readNext() {
    let stream, state;

    while (!isDone) {
      if (!state1.ended
          && (state2.ended || state1.totalDataLen <= state2.totalDataLen)) {
        stream = stream1;
        state = state1;
      } else if (!state2.ended) {
        stream = stream2;
        state = state2;
      } else {
        debug('All streams have ended.  No further reads.');
        return;
      }

      const data = stream.read();
      if (data === null) {
        debug(`Waiting for ${streamName(stream)} to be readable...`);
        stream.once('readable', readNext);
        return;
      }

      handleData.call(stream, state, data);
    }
  }
855742
def peek(self):
        
        try:
            self._fetch()
            pkt = self.pkt_queue[0]
            return pkt
        except IndexError:
            raise StopIteration()
554991
def get_token(self):
        ""
        if self.pushback:
            tok = self.pushback.popleft()
            return tok
        # No pushback.  Get a token.
        raw = self.read_token()
        # Handle inclusions
        if self.source is not None:
            while raw == self.source:
                spec = self.sourcehook(self.read_token())
                if spec:
                    (newfile, newstream) = spec
                    self.push_source(newstream, newfile)
                raw = self.get_token()
        # Maybe we got EOF instead?
        while raw == self.eof:
            if not self.filestack:
                return self.eof
            else:
                self.pop_source()
                raw = self.get_token()
        # Neither inclusion nor EOF
        return raw
1368282
@Nonnull
    public Token peek(String message) throws IOException {
        if (!hasNext()) {
            throw failure(lineNo, linePos + 1, 0, "Expected %s: Got end of file", message);
        }
        return unreadToken;
    }
90598
def peek(self, size=-1):
        
        self._check_can_read()
        if self._mode == _MODE_READ_EOF or not self._fill_buffer():
            return b""
        return self._buffer
617011
def readout(self, fifo, no_data_timeout=None):
        '''
        '''
        logging.info('Starting readout thread for %s', fifo)
        time_last_data = time()
        time_wait = 0.0
        empty_reads = 0
        while not self.force_stop[fifo].wait(time_wait if time_wait >= 0.0 else 0.0):
            time_read = time()
            try:
                if no_data_timeout and time_last_data + no_data_timeout < get_float_time():
                    raise NoDataTimeout('Received no data for %0.1f second(s) from %s' % (no_data_timeout, fifo))
                raw_data = self.read_raw_data_from_fifo(fifo)
            except NoDataTimeout:
                no_data_timeout = None  # raise exception only once
                if self.errback:
                    self.errback(sys.exc_info())
                else:
                    raise
            except Exception:
                if self.errback:
                    self.errback(sys.exc_info())
                else:
                    raise
                if self.stop_readout.is_set():  # in case of a exception, break immediately
                    break
            else:
                n_data_words = raw_data.shape[0]
                if n_data_words > 0:
                    time_last_data = time()
                    empty_reads = 0
                    time_start_read, time_stop_read = self.update_timestamp(fifo)
                    status = 0
                    self._fifo_data_deque[fifo].append((raw_data, time_start_read, time_stop_read, status))
                    with self._fifo_conditions[fifo]:
                        self._fifo_conditions[fifo].notify_all()
                elif self.stop_readout.is_set():
                    if empty_reads == self._n_empty_reads:
                        break
                    else:
                        empty_reads += 1
            finally:
                # ensure that the readout interval does not depend on the processing time of the data
                # and stays more or less constant over time
                time_wait = self.readout_interval - (time() - time_read)
        self._fifo_data_deque[fifo].append(None)  # last item, None will stop worker
        with self._fifo_conditions[fifo]:
            self._fifo_conditions[fifo].notify_all()
        logging.info('Stopping readout thread for %s', fifo)
41571
protected void readUntil(char echar) throws IOException
    {
        int ch, i = 0;
        IStringBuffer sb = new IStringBuffer();
        while ( (ch = readNext()) != -1 ) {
            if ( ++i >= MAX_QUOTE_LENGTH ) {
                /*
                 * push back the readed chars
                 * and reset the global idx value. 
                */
                for ( int j = sb.length() - 1; j >= 0; j-- ) {
                    reader.unread(sb.charAt(j));
                }
                idx -= sb.length();
                break;
            }
            
            sb.append((char)ch);
            if ( ch == echar ) {
                gisb.append(sb.toString());
                break;
            }
        }
        
        sb = null;
    }
289067
def peek(self) -> str:
        
        try:
            return self.input[self.offset]
        except IndexError:
            raise EndOfInput(self)
1112794
private void scanOperator() {
        while (true) {
            reader.putChar(false);
            Name newname = reader.name();
            TokenKind tk1 = tokens.lookupKind(newname);
            if (tk1 == TokenKind.IDENTIFIER) {
                reader.sp--;
                break;
            }
            tk = tk1;
            reader.scanChar();
            if (!isSpecial(reader.ch)) break;
        }
    }