Find the codeline end by taking out the counters and durations.

def _strip_counters(self, sub_line):
        """Find the codeline end by taking out the counters and durations."""
        try:
            end = sub_line.rindex('}')
        except ValueError:
            return sub_line
        else:
            return sub_line[:(end + 1)]