<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)]