returns an array with each line following the current line, which is not a gem line
323308
def following_non_gem_lines
      all_lines[(index+1)..(-1)].
          reject {|x| x.strip.empty? || x.match(GemBench::TRASH_REGEX) }.
          map(&:strip).
          inject([]) do |following_lines, next_line|
            break following_lines if next_line.match(GEM_REGEX)
            following_lines << next_line
      end
    end
894405
def get_import_lines(self):
        
        if self.imports:
            return ["from %s import %s" % (value, key) for key, value in self.imports.items()]
        else:
            return []
169750
function(code) {
    var lines = [];
    code.split(/\n/).forEach(line => {
      var segs = line.split(/(\s*#)/);
      var ln = {code: segs[0]};
      if (segs.length > 1)
        ln.comment = segs.reduce((c, seg, i) => i > 1 ? c + seg : seg, '');
      lines.push(ln);
    });
    return lines;
  }
1248623
def matching_lines(re)
      @lines.each_with_index.select{|text, linenum| re.match(text)}.map{
        |i| i[1]+1}
    end
1316637
def parse_line
      s0 = @current_pos
      match_spaces
      s2 = parse_te
      if s2 != :failed
        match_spaces
        s4 = @current_pos
        s5 = parse_fugou
        if s5 != :failed
          s6 = parse_from
          if s6 != :failed
            @reported_pos = s4
            s4 = transform_teban_fugou_from(s2, s5, s6)
          else
            @current_pos = s4
            s4 = :failed
          end
        else
          @current_pos = s4
          s4 = :failed
        end
        if s4 == :failed
          s4 = @current_pos
          s5 = []
          s6 = match_regexp(/^[^\r\n ]/)
          while s6 != :failed
            s5 << s6
            s6 = match_regexp(/^[^\r\n ]/)
          end
          @reported_pos = s4
          s4 = s5.join
        end
        if s4 != :failed
          match_spaces
          s6 = parse_time
          s6 = nil if s6 == :failed
          match_str("+")
          if parse_nl != :failed
            @reported_pos = s0
            s0 = { "move" => s4, "time" => s6 }
          else
            @current_pos = s0
            s0 = :failed
          end
        else
          @current_pos = s0
          s0 = :failed
        end
      else
        @current_pos = s0
        s0 = :failed
      end
      s0
    end
984486
def index_each_line
        positions = []
        size = 0
        each_line do |line|
          positions << [size, line.size]
          size += line.size
        end
        rewind
        positions
      end
1232
function(code)
        {
            var lines = [],
                firstLine = parseInt(this.getParam('first-line'))
                ;

            eachLine(code, function(line, index)
            {
                lines.push(index + firstLine);
            });

            return lines;
        }
698394
def parse_blocks(lines):  # type: (List[str]) -> List[List[str]]
    
    blocks = []

    while lines:
        if lines[0] == '':
            lines.pop(0)
        else:
            blocks.append(parse_block(lines))

    return blocks
1363736
def parse_wal_files_list(lines)
      wal_files = Array.new
      lines.each do |line|
        wal_files << WalFile.parse(line.split("/").last)
      end
      return wal_files
    end
1320660
def each_with_depth(from: nil, to: nil, &block)
      Array(lines).each_with_index do |line, index|
        next if index < (from || 0)

        depth = line.length - line.lstrip.length
        block.call(line.strip, depth, index)

        break if to == index
      end

      nil
    end
254524
def lines(input):
    """"""
    for raw_line in input:
        line = raw_line.strip()
        if line and not line.startswith('#'):
            yield strip_comments(line)
167977
def split_lines(lines):
    
    container = []
    new_list = []
    for line in lines:
        if '>>>' in line:
            container.append(new_list)
            new_list = []
        else:
            new_list.append(line)
    container.append(new_list)
    return container
1204015
def get_lines(fname):
    """"""
    for line in fileinput.input(fname):
        yield fileinput.filelineno(), line.strip()
966069
def get_lines(self, first, last):
        """"""
        line = 1
        linestring = []
        linestrings = []
        for char in self.string:
            if line >= first and line <= last:
                linestring.append(char)
                if char == '\n':
                    linestrings.append((''.join(linestring), line))
                    linestring = []
            elif line > last:
                break

            if char == '\n':
                line += 1
        if linestring:
            linestrings.append((''.join(linestring), line))
        elif not linestrings:
            return None

        return [SourceLine(string, lineno) for string, lineno in linestrings]
128930
def splitlines(self, keepends=False):
        """"""
        lines = self.split('\n')
        return [line+'\n' for line in lines] if keepends else (
               lines if lines[-1] else lines[:-1])
955384
def readlines(self):
        """"""
        if self.grammar:
            tot = []
            # Used this way instead of a 'for' loop against
            # self.file.readlines() so that there wasn't two copies of the file
            # in memory.
            while 1:
                line = self.file.readline()
                if not line:
                    break
                tot.append(line)
            return tot
        return self.file.readlines()
761336
def get_all_lines(self):
        """"""
        output = []
        line = []
        lineno = 1
        for char in self.string:
            line.append(char)
            if char == '\n':
                output.append(SourceLine(''.join(line), lineno))
                line = []
                lineno += 1
        if line:
            output.append(SourceLine(''.join(line), lineno))

        return output