Get next char from raw queue.

        Raise EOFError when connection is closed.
431776
def rawq_getchar(self):
        
        if not self.rawq:
            yield from self.fill_rawq()
            if self.eof:
                raise EOFError
        c = self.rawq[self.irawq:self.irawq + 1]
        self.irawq = self.irawq + 1
        if self.irawq >= len(self.rawq):
            self.rawq = b''
            self.irawq = 0
        return c
58097
def get_one(seq, default=None, skip_string_iter=True):
    
    if skip_string_iter and isinstance(seq, (str, unicode, bytes, bytearray)):
        return seq
    if not seq:
        return ''
    try:
        return next(iter(seq))
    except TypeError:
        # not hasattr __iter__/__getitem__
        return default
1292843
def get_next(self, num_bytes=None):
        """"""
        if num_bytes is None:
            return self._data[self._offset:]
        else:
            return self._data[self._offset:self._offset + num_bytes]
5486
def char(self):
        
        # Read a new chunk from the input stream if necessary
        if self.chunkOffset >= self.chunkSize:
            if not self.readChunk():
                return EOF

        chunkOffset = self.chunkOffset
        char = self.chunk[chunkOffset]
        self.chunkOffset = chunkOffset + 1

        return char
250208
protected String getNextLine(int newlineCount) throws IOException {
        if (newlineCount == 0) {
            return "";
        }
        StringBuffer str = new StringBuffer();
        int b;
        while (pis.available() > 0) {
            b = pis.read();
            if (b == -1) {
                return "";
            }
            if (b == '\n') {
                newlineCount--;
                if (newlineCount == 0) {
                    log.debug("Read lines: " + str.toString());
                    String[] lines = str.toString().split("\n");
                    // FIXME: this leads to queuing lines so we will have time lag!
                    return lines[lines.length - 1];
                }
            }
            str.append((char) b);
        }
        return "";
    }
608094
function next() {
  var limireq = this;
  var conn = limireq.connections.shift()
  if (!conn) return

  request(conn.options, function(err, res, body) {
    if (typeof conn.callback === 'function')
      conn.callback(err, res, body)
    else
      limireq.emit('data', err, res, body)

    // Signal the end of processing
    if (++limireq.completed === limireq.total) {
      limireq.active = false
      limireq.emit('end')
    } else next.call(limireq)
  })
}
1077426
int nextIndexOf(CharSequence seq) {
        bufferUp();
        // doesn't handle scanning for surrogates
        char startChar = seq.charAt(0);
        for (int offset = bufPos; offset < bufLength; offset++) {
            // scan to first instance of startchar:
            if (startChar != charBuf[offset])
                while(++offset < bufLength && startChar != charBuf[offset]) { /* empty */ }
            int i = offset + 1;
            int last = i + seq.length()-1;
            if (offset < bufLength && last <= bufLength) {
                for (int j = 1; i < last && seq.charAt(j) == charBuf[i]; i++, j++) { /* empty */ }
                if (i == last) // found full sequence
                    return offset - bufPos;
            }
        }
        return -1;
    }
1076408
public int peekChar() throws IOException {
	
	// load more characters, if needed
	if (fCurrentEntity.position == fCurrentEntity.count) {
	    load(0, true);
	}
	
	// peek at character
	int c = fCurrentEntity.ch[fCurrentEntity.position];

	// return peeked character
	if (fCurrentEntity.isExternal()) {
	    return c != '\r' ? c : '\n';
	}
	else {
	    return c;
	}
	
    }
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
410276
def next(self):
        
        if self._has_finished:
            raise StopIteration

        if not len(self._buffer):
                    
            results = self.fetch_next_block()
            self._buffer.extend(results)
            
        if not len(self._buffer):
            raise StopIteration
            
        return self._buffer.popleft()
543139
def read_very_lazy(self):
        
        buf = self.cookedq.getvalue()
        self.cookedq.seek(0)
        self.cookedq.truncate()
        if not buf and self.eof and not self.rawq:
            raise EOFError('telnet connection closed')
        return buf
701282
public char next() throws JSONException {
        int c;
        if (this.usePrevious) {
            this.usePrevious = false;
            c = this.previous;
        } else {
            try {
                c = this.reader.read();
            } catch (IOException exception) {
                throw new JSONException(exception);
            }
        }
        if (c <= 0) { // End of stream
            this.eof = true;
            return 0;
        }
        this.incrementIndexes(c);
        this.previous = (char) c;
        return this.previous;
    }
950100
def get_char(prompt=None):
    
    while True:
        s = get_string(prompt)
        if s is None:
            return None
        if len(s) == 1:
            return s[0]

        # Temporarily here for backwards compatibility
        if prompt is None:
            print("Retry: ", end="")
91488
def next(self):
        """"""
        _LOGGER.debug("reading next")
        if self.closed:
            _LOGGER.debug("stream is closed")
            raise StopIteration()

        line = self.readline()
        if not line:
            _LOGGER.debug("nothing more to read")
            raise StopIteration()

        return line
592236
def _get_queue(self):
        
        if self._queue is None:
            self._links = []
            queue, depth = self._resolve_queue(self.queue, links=self._links)
            if queue is None and depth > 0:
                raise QueueLinkBroken
            self._queue = queue
        return self._queue
710588
def _next_method(self):
        """"""
        queue = self.queue
        put = self._quick_put
        read_frame = self.source.read_frame
        while not queue:
            try:
                frame_type, channel, payload = read_frame()
            except Exception as exc:
                #
                # Connection was closed?  Framing Error?
                #
                put(exc)
                break

            self.bytes_recv += 1

            if frame_type not in (self.expected_types[channel], 8):
                put((
                    channel,
                    UnexpectedFrame(
                        'Received frame {0} while expecting type: {1}'.format(
                            frame_type, self.expected_types[channel]))))
            elif frame_type == 1:
                self._process_method_frame(channel, payload)
            elif frame_type == 2:
                self._process_content_header(channel, payload)
            elif frame_type == 3:
                self._process_content_body(channel, payload)
            elif frame_type == 8:
                self._process_heartbeat(channel, payload)
749471
def last_string(self):
        """"""
        cb = self.code_builder
        len_cb = len(cb)
        if len_cb > 0:
            return cb[len_cb - 1]
        else:
            return None