<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def end_experiment(self):
 """Terminates a running experiment"""

        if self.exp_config.get("mode") != "debug":
            HerokuApp(self.app_id).destroy()
        return True