<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _finish(self):
 """Mark transition as finished and execute callback."""

        self.finished = True
        if self._callback:
            self._callback(self)
        self._finish_event.set()