def _extract_rsnap_isteps(rproffile):
step_regex = re.compile(r'<STR_LIT>')<EOL>isteps = []  <EOL>rows_to_del = set()<EOL>line = '<STR_LIT:U+0020>'<EOL>with rproffile.open() as stream:<EOL><INDENT>while line[<NUM_LIT:0>] != '<STR_LIT:*>':<EOL><INDENT>line = stream.readline()<EOL><DEDENT>match = step_regex.match(line)<EOL>istep = int(match.group(<NUM_LIT:1>))<EOL>time = float(match.group(<NUM_LIT:2>))<EOL>nlines = <NUM_LIT:0><EOL>iline = <NUM_LIT:0><EOL>for line in stream:<EOL><INDENT>if line[<NUM_LIT:0>] == '<STR_LIT:*>':<EOL><INDENT>isteps.append((istep, time, nlines))<EOL>match = step_regex.match(line)<EOL>istep = int(match.group(<NUM_LIT:1>))<EOL>time = float(match.group(<NUM_LIT:2>))<EOL>nlines = <NUM_LIT:0><EOL>nrows_to_del = <NUM_LIT:0><EOL>while isteps and istep <= isteps[-<NUM_LIT:1>][<NUM_LIT:0>]:<EOL><INDENT>nrows_to_del += isteps.pop()[-<NUM_LIT:1>]<EOL><DEDENT>rows_to_del = rows_to_del.union(<EOL>range(iline - nrows_to_del, iline))<EOL><DEDENT>else:<EOL><INDENT>nlines += <NUM_LIT:1><EOL>iline += <NUM_LIT:1><EOL><DEDENT><DEDENT>isteps.append((istep, time, nlines))<EOL><DEDENT>return isteps, rows_to_del<EOL>
Extract istep and compute list of rows to delete