Peek at the next item in the queue
328597
def peek(self):
        
        # Ammortized O(1)
        _heap = self._heap
        _dict = self._dict
        val, key = _heap[0]
        # Remove items marked for lazy deletion as they are encountered
        while key not in _dict or _dict[key] != val:
            self._heappop(_heap)
            val, key = _heap[0]
        return key, val
1310970
def peek(count = nil)
      jids = JSON.parse(@client.call('peek', @name, (count || 1)))
      jobs = jids.map { |j| Job.new(@client, j) }
      count.nil? ? jobs[0] : jobs
    end
1137622
public QueueItem peek() {
        QueueItem item = getItemQueue().peek();
        if (item == null) {
            return null;
        }
        if (store.isEnabled() && item.getData() == null) {
            try {
                load(item);
            } catch (Exception e) {
                throw new HazelcastException(e);
            }
        }
        return item;
    }
303814
def peek(self, n=1):
        """"""
        if n > len(self._readbuffer) - self._offset:
            chunk = self.read(n)
            self._offset -= len(chunk)

        # Return up to 512 bytes to reduce allocation overhead for tight loops.
        return self._readbuffer[self._offset: self._offset + 512]
1040991
def _next(self):
        
        c = self._get()
        if c == '/':
            p = self._peek()
            if p == '/':
                c = self._get()
                while c > '\n':
                    c = self._get()
                return c
            if p == '*':
                c = self._get()
                while 1:
                    c = self._get()
                    if c == '*':
                        if self._peek() == '/':
                            self._get()
                            return ' '
                    if c == '\000':
                        raise UnterminatedComment()

        return c
10455
def look(self):
        """"""
        old_token = next(self)
        result = self.current
        self.push(result)
        self.current = old_token
        return result
1090112
def _next_job(self):
        """"""
        if self.__job_queue:
            # Produce message from the top of the queue
            job = self.__job_queue.pop()
            # logging.debug("queue = %s, popped %r", self.__job_queue, job)
            job.process()
483694
def select_next(self):
        """"""
        self.footer.clear_message()

        old_index = self.selected
        new_index = self.selected + 1

        # Load more statuses if no more are available
        if self.selected + 1 >= len(self.statuses):
            self.fetch_next()
            self.left.draw_statuses(self.statuses, self.selected, new_index - 1)
            self.draw_footer_status()

        self.selected = new_index
        self.redraw_after_selection_change(old_index, new_index)
983201
private void seekNext() {
    if (!needSeek) {
      return;
    }

    // First, iterate all
    if (this.currentIterator != null && this.currentIterator.hasNext()) {
      needSeek = false;
      return;
    }

    // Then, find the next available work unit
    nextWu = null;
    this.currentIterator = null;
    while (nextWu == null && workUnits.hasNext()) {
      nextWu = workUnits.next();
      if (nextWu instanceof MultiWorkUnit) {
        this.currentIterator = ((MultiWorkUnit) nextWu).getWorkUnits().iterator();
        if (!this.currentIterator.hasNext()) {
          nextWu = null;
        }
      }
    }

    needSeek = false;
  }
873248
def next_row(self):
        """"""
        row = self.currentIndex().row()
        rows = self.proxy_model.rowCount()
        if row + 1 == rows:
            row = -1
        self.selectRow(row + 1)
1267194
def next(self):
        
        if self._orderByPQ.size() > 0:
            
            targetRangeExContext = self._orderByPQ.pop()
            res = next(targetRangeExContext)
            
            try:
                """TODO: we can also use more_itertools.peekable to be more python friendly"""
                targetRangeExContext.peek()
                self._orderByPQ.push(targetRangeExContext)

            except StopIteration:
                pass
                
            return res
        raise StopIteration
289067
def peek(self) -> str:
        
        try:
            return self.input[self.offset]
        except IndexError:
            raise EndOfInput(self)
1307719
private void nextQueue()
  {
    if(super.hasNext())
    {      
      do
      {
        if(_currentSubIterator != null) _currentSubIterator.finished();
        _currentSubIterator = null;
        _currentQueue = (SIMPQueueControllable) super.next();
        
        try
        {
          _currentSubIterator = _currentQueue.getRemoteQueuePointIterator();
        }
        catch (SIMPException e) 
        {
          // No FFDC code needed
        
          if (tc.isDebugEnabled())
            SibTr.exception(tc, e);          
        }       
      }
      // Retry if we failed to get an iterator, that iterator does not
      // have any remote queue points in it and we have more queues available.
      while((_currentSubIterator == null || !_currentSubIterator.hasNext())
        && super.hasNext());
    }
    else
    {
      _currentQueue = null;
      if(_currentSubIterator != null) _currentSubIterator.finished();
      _currentSubIterator = null;
    }
  }
881887
def peek(self, count=None):
        ''''''
        results = [Job(self.client, **rec) for rec in json.loads(
            self.client('peek', self.name, count or 1))]
        if count is None:
            return (len(results) and results[0]) or None
        return results
1106400
def next(self):
        
        self.open_read()
        data = self.resp.read(self.BufferSize)
        if not data:
            self.close()
            raise StopIteration
        return data
778310
def list_items(queue):
    '''
    
    '''
    itemstuple = _list_items(queue)
    items = [item[0] for item in itemstuple]
    return items
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;
            }
        }
    }