A variant of #lines that only iterates over specific Line names. Since
 the name is known, only the Line#value is returned or yielded.
18264
def values(name)
      unless block_given?
        lines(name).map { |line| line.value }
      else
        lines(name) { |line| yield line.value }
      end
    end
579249
def get_lines(filename: str) -> Iterator[str]:
    """"""
    if filename.endswith('.gz'):
        with gzip.open(filename, 'r') as f:
            for line in f:
                yield line.decode('utf-8')
    else:
        with open(filename, 'r', encoding='utf-8') as f:
            for line in f:
                yield line
166708
def each_line
      original_line_number = @original_line_number
      modified_line_number = @modified_line_number

      @lines.each do |line|
        if line.addition?
          yield line, nil, modified_line_number
          modified_line_number += 1
        elsif line.deletion?
          yield line, original_line_number, nil
          original_line_number += 1
        elsif line.unchanged?
          yield line, original_line_number, modified_line_number
          original_line_number += 1
          modified_line_number += 1
        else
          yield line
        end
      end
    end
444686
def get_tokens(line: str) -> Iterator[str]:
    
    for token in line.rstrip().split():
        if len(token) > 0:
            yield token
1131949
def _read_line(self, f):
        
        l = f.readline().strip()
        while l == "" or l[0] == "#": # comment or an empty line
            l = f.readline().strip()
        return l
166453
function(line, index, lines) {
        var hasPipe = /^\s*\|\>/;
        var nextLine = lines[index + 1] || '';

        if (line.match(hasPipe)|| !nextLine.match(hasPipe)) {
          return line;
        }
        // handle wrapping returned values
        else if (line.match(/^\s*return/)) { // starts with return
          return line.replace(/^return (.+)/, function($0, $1) {
              return 'return _.chain(' + $1 +')';
          });
        }
        // handle wrapping assignments eg, foo = [1, 2, 3]
        else if (line.match(/^\s*[\w$]+\s+\=\s+/)) { // starts with `foo =`
          return line.replace(/(^\s*[\w$]+\s+\=\s+)(.+)/, function($0, $1, $2) {
              return $1 + '_.chain(' + $2 +')';
          });
        }
        else if (!!line.trim()) {
          return '_.chain(' + line + ')';
        }
        else {
          return line;
        }
    }
182488
def at_line(self, line: FileLine) -> Iterator[Statement]:
        
        num = line.num
        for stmt in self.in_file(line.filename):
            if stmt.location.start.line == num:
                yield stmt
1298035
def iter_lines(file_like: Iterable[str]) -> Generator[str, None, None]:
    
    for line in file_like:
        line = line.rstrip('\r\n')
        if line:
            yield line
567255
def lines(text):
    
    assert text is not None
    assert '\r' not in text
    previous_newline_index = 0
    newline_index = text.find('\n')
    while newline_index != -1:
        yield text[previous_newline_index:newline_index]
        previous_newline_index = newline_index + 1
        newline_index = text.find('\n', previous_newline_index)
    last_line = text[previous_newline_index:]
    if last_line != '':
        yield last_line
1203359
def lines(self: object, fileids: str, plaintext: bool = True):
        

        for text in self.texts(fileids, plaintext):
            text = re.sub(r'\n\s*\n', '\n', text, re.MULTILINE) # Remove blank lines
            for line in text.split('\n'):
                yield line
1058391
def lines
      @lines ||= begin
        all_lines = @buffer.source_lines
        last_token_line = tokens.any? ? tokens.last.line : all_lines.size
        result = []
        all_lines.each_with_index do |line, ix|
          break if ix >= last_token_line && line == '__END__'

          result << line
        end
        result
      end
    end
653029
def get_all( line )
      retval = nil
      m = /^\s*;\s*all_parts\s*(.+)[^\s]*/.match( line )
      if m && m[1]
        retval = m[1]
      end
      return retval
    end
715002
def iter_token_lines(tokenlist):
    
    line = []
    for token, c in explode_tokens(tokenlist):
        line.append((token, c))

        if c == '\n':
            yield line
            line = []

    yield line
1085899
def line_numbers
      return (line..line) unless @value && text

      end_line = line + lines.count
      end_line = nontrivial_end_line if line == end_line

      (line..end_line)
    end
1329377
def join_lines(lines_enum):
    # type: (ReqFileLines) -> ReqFileLines
    
    primary_line_number = None
    new_line = []  # type: List[Text]
    for line_number, line in lines_enum:
        if not line.endswith('\\') or COMMENT_RE.match(line):
            if COMMENT_RE.match(line):
                # this ensures comments are always matched later
                line = ' ' + line
            if new_line:
                new_line.append(line)
                yield primary_line_number, ''.join(new_line)
                new_line = []
            else:
                yield line_number, line
        else:
            if not new_line:
                primary_line_number = line_number
            new_line.append(line.strip('\\'))

    # last line contains \
    if new_line:
        yield primary_line_number, ''.join(new_line)
923365
def getlines(fname):
    

    with open(fname, 'rU') as f:
        for line in f:
            if line.strip() and not line.startswith('#'):
                yield line.split('#', 1)[0].strip()
971669
def find_fields name
      res = {}
      @lines.each do | line |
        value = line.scan(/###{name}=<(.*)>/)
        if value[0]
          str = value[0][0]
          # p str
          v = VcfHeaderParser.parse_field(line,@debug)
          id = v['ID']
          res[id] = v
        end
      end
      # p res
      res
    end