Check and return the next physical line. This method can be
        used to feed tokenize.generate_tokens.
965894
def readline_check_physical(self):
        
        line = self.readline()
        if line:
            self.check_physical(line)
        return line
1306042
def next(self, data=None):
        '''
        
        '''
        if data is None:
            if self.stream:
                data = self.stream.readline()
            else:
                return

        lines = (self.buffer + data).split('\n')
        self.buffer = lines.pop()

        for line in lines:
            try:
                msg = nmea.NMEASentence.parse(line)
                yield msg
            except nmea.ParseError as e:
                if self.errors == 'raise':
                    raise e
                if self.errors == 'yield':
                    yield e
                if self.errors == 'ignore':
                    pass
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 "";
    }
405511
@SuppressWarnings("unchecked")
  @Override
  protected T getNext() {
    T token = null;
    if (lexer == null) {
      return token;
    }
    try {
      token = (T) lexer.next();
      while (token != null && token.word().equals(WhitespaceLexer.NEWLINE)) {
        if (eolIsSignificant) {
          return token;
        } else {
          token = (T) lexer.next();
        }
      }
    } catch (IOException e) {
      // do nothing, return null
    }
    return token;
  }
138513
def token(self):
        

        if self.tokens_queue:
            self.last_token = self.tokens_queue.pop(0)
        else:
            r = self.lex.token()
            if isinstance(r, MultiToken):
                self.tokens_queue.extend(r.tokens)
                self.last_token = self.tokens_queue.pop(0)
            else:
                if r is None and self.cur_indent > 0:
                    if (self.last_token and
                            self.last_token.type not in ('NEWLINE', 'LINE')):
                        newline_token = _create_token(
                            'NEWLINE', '\n', self.lex.lineno, self.lex.lexpos)
                        self.tokens_queue.append(newline_token)
                    dedent_count = self.cur_indent
                    dedent_token = _create_token(
                        'DEDENT', '\t', self.lex.lineno, self.lex.lexpos)
                    self.tokens_queue.extend([dedent_token] * dedent_count)

                    self.cur_indent = 0
                    self.last_token = self.tokens_queue.pop(0)
                else:
                    self.last_token = r
        return self.last_token
450519
def next(self):
    """"""
    self._has_iterated = True

    if self._read_before_start:
      self._blob_reader.readline()
      self._read_before_start = False
    start_position = self._blob_reader.tell()

    if start_position > self._end_position:
      raise StopIteration()

    line = self._blob_reader.readline()

    if not line:
      raise StopIteration()

    return start_position, line.rstrip("\n")
1350900
def build_tokens_line(self):
        
        self.mapping = []
        logical = []
        length = 0
        previous = None
        for token in self.tokens:
            token_type, text = token[0:2]
            if token_type in (tokenize.COMMENT, tokenize.NL,
                              tokenize.INDENT, tokenize.DEDENT,
                              tokenize.NEWLINE):
                continue
            if token_type == tokenize.STRING:
                text = mute_string(text)
            if previous:
                end_line, end = previous[3]
                start_line, start = token[2]
                if end_line != start_line: # different row
                    if self.lines[end_line - 1][end - 1] not in '{[(':
                        logical.append(' ')
                        length += 1
                elif end != start: # different column
                    fill = self.lines[end_line - 1][end:start]
                    logical.append(fill)
                    length += len(fill)
            self.mapping.append((length, token))
            logical.append(text)
            length += len(text)
            previous = token
        self.logical_line = ''.join(logical)
        assert self.logical_line.lstrip() == self.logical_line
        assert self.logical_line.rstrip() == self.logical_line
508483
def readline(self, size=-1):
        ""
        try:
            record = next(self.reader)
            return self.outdel.join(self.process_line(record)) + '\n'
        except StopIteration:
            return ''
1150506
def next_token(self):
        """"""
        while self.char is not None:

            if self.char.isspace():
                # The current character is a whitespace
                self.whitespace()
                continue

            elif self.char == '#':
                # The current character is `#`
                self.advance()
                self.comment()
                continue

            elif self.char.isalpha() or self.char == '_':
                # The current character is a letter or `_`
                return self._id()

            elif self.char == ';':
                # The current character is `;`
                self.advance()
                return Token(Nature.SEMI, ';')

            elif self.char == ',':
                # The current character is `,`
                self.advance()
                return Token(Nature.COMMA, ';')

            elif self.char.isdigit():
                # The current character is a number
                return self.number()

            elif self.char == '=' and self.peek() == '=':
                # The current character is `==`
                self.advance()
                self.advance()
                return Token(Nature.EQ, '==')

            elif self.char == '!' and self.peek() == '=':
                # The current character is `!=`
                self.advance()
                self.advance()
                return Token(Nature.NE, '!=')

            elif self.char == '<' and self.peek() == '=':
                # The current character is `<=`
                self.advance()
                self.advance()
                return Token(Nature.LE, '<=')

            elif self.char == '>' and self.peek() == '=':
                # The current character is `>=`
                self.advance()
                self.advance()
                return Token(Nature.GE, '>=')

            elif self.char == '<':
                # The current character is `<`
                self.advance()
                return Token(Nature.LT, '<')

            elif self.char == '>':
                # The current character is `>`
                self.advance()
                return Token(Nature.GT, '>')

            elif self.char == '=':
                # The current character is `=`
                self.advance()
                return Token(Nature.ASSIGN, '=')

            elif self.char == '+':
                # The current character is `+`
                self.advance()
                return Token(Nature.PLUS, '+')

            elif self.char == '-':
                # The current character is `-`
                self.advance()
                return Token(Nature.MINUS, '-')

            elif self.char == '*':
                # The current character is `*`
                self.advance()
                return Token(Nature.MUL, '*')

            elif self.char == '/' and self.peek() == '/':
                # The current character is `//`
                self.advance()
                self.advance()
                return Token(Nature.INT_DIV, '//')

            elif self.char == '/':
                # The current character is `/`
                self.advance()
                return Token(Nature.DIV, '/')

            elif self.char == '(':
                # The current character is `(`
                self.advance()
                return Token(Nature.LPAREN, '(')

            elif self.char == ')':
                # The current character is `)`
                self.advance()
                return Token(Nature.RPAREN, ')')

            elif self.char == '{':
                # The current character is `{`
                self.advance()
                return Token(Nature.LBRACKET, '{')

            elif self.char == '}':
                # The current character is `}`
                self.advance()
                return Token(Nature.RBRACKET, '}')

            else:
                # The current character is unknown
                raise LexicalError(f"Invalid character `{self.char}`.")

        # End of raw input
        return Token(Nature.EOF, None)
135790
def generate_tokens(self):
        """"""
        if self._io_error:
            self.report_error(1, 0, 'E902 %s' % self._io_error, readlines)
        tokengen = tokenize.generate_tokens(self.readline)
        try:
            for token in tokengen:
                if token[2][0] > self.total_lines:
                    return
                self.noqa = token[4] and noqa(token[4])
                self.maybe_check_physical(token)
                yield token
        except (SyntaxError, tokenize.TokenError):
            self.report_invalid_syntax()
943470
def next_line(self, require_prefix=True):
        
        if require_prefix:
            m = self.expect_re(r'(?m)[^\n]*?$\n?')
        else:
            m = self._expect_re(r'(?m)[^\n]*$\n?', self.pos)
        self.match = m
        if m:
            return m.group()
1237461
def maybe_check_physical(self, token):
        """"""
        # Called after every token, but act only on end of line.
        if _is_eol_token(token):
            # Obviously, a newline token ends a single physical line.
            self.check_physical(token[4])
        elif token[0] == tokenize.STRING and '\n' in token[1]:
            # Less obviously, a string that contains newlines is a
            # multiline string, either triple-quoted or with internal
            # newlines backslash-escaped. Check every physical line in the
            # string *except* for the last one: its newline is outside of
            # the multiline string, so we consider it a regular physical
            # line, and will check it like any other physical line.
            #
            # Subtleties:
            # - we don't *completely* ignore the last line; if it contains
            #   the magical "# noqa" comment, we disable all physical
            #   checks for the entire multiline string
            # - have to wind self.line_number back because initially it
            #   points to the last line of the string, and we want
            #   check_physical() to give accurate feedback
            if noqa(token[4]):
                return
            self.multiline = True
            self.line_number = token[2][0]
            for line in token[1].split('\n')[:-1]:
                self.check_physical(line + '\n')
                self.line_number += 1
            self.multiline = False
24007
def token_or_comment_or_line_generator(buffer):
    """"""
    tok_or_com_gen = token_or_comment_generator(buffer)
    line_gen = line_generator(buffer)

    tok_or_com = next(tok_or_com_gen, None)
    line = next(line_gen, None)

    while tok_or_com is not None or line is not None:
        if tok_or_com is None or (line is not None and
                                  tok_or_com.line_no > line.line_no):
            yield line
            line = next(line_gen, None)
        else:
            yield tok_or_com
            tok_or_com = next(tok_or_com_gen, None)
726942
public String getNextLine() {
		if (!isNextLine()) {
			return null;
		}
		if (isTag(nextLine))
			return FlatFileUtils.trimRight(nextLine,
					getTagWidth(nextLine));
		else
			return nextLine.trim();
	}
208882
public boolean nextLine() {
	while (isValidIndex() && text[pos] != '\n') {
	    next();
	}
	if (isValidIndex() && text[pos] == '\n') {
	    next();
	    return isValidIndex();
	}
	return false;
    }
315981
def next(self):
        
        if self.index < self.length:
            index = self.index
            self.index += 1
            return self.data[index]
        else:
            raise StopIteration()
589637
protected function scanNewLine()
    {

        foreach ($this->scanToken('newLine', "\n") as $token) {

            $this->line++;
            $this->offset = 0;
            yield $token;
        }
    }