<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):
 """Marks trial as completed if it is paused and has previously ran."""

        if trial.status is Trial.PAUSED and trial in self._results:
            self._completed_trials.add(trial)