def METHOD_NAME(self, it, line):
    """ Iterate over lines and parse stack traces. """
    events = []
    stack_traces = []
    while self.stack_trace_re.match(line):
        event = self.parse_stack_trace_line(line)
        if event:
            events.append(event)
        stack_traces.append(line)
        line = get_next(it)
    events.reverse()
    return stack_traces, events, line