<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_trial_remove(self, trial_runner, trial):
 """Notification when trial terminates. Trial info is removed from bracket. Triggers halving if bracket is not finished."""

        bracket, _ = self._trial_info[trial]
        bracket.cleanup_trial(trial)
        if not bracket.finished():
            self._process_bracket(trial_runner, bracket, trial)