code: def trial_end(self, trial_job_id, success):
          
          if trial_job_id in self.running_history:
              if success:
                  cnt = 0
                  history_sum = 0
                  self.completed_avg_history[trial_job_id] = []
                  for each in self.running_history[trial_job_id]:
                      cnt += 1
                      history_sum += each
                      self.completed_avg_history[trial_job_id].append(history_sum / cnt)
              self.running_history.pop(trial_job_id)
          else:
              logger.warning('trial_end: trial_job_id does not in running_history')
docs: trial_end
          
          Parameters
          ----------
          trial_job_id: int
              trial job id
          success: bool
              True if succssfully finish the experiment, False otherwise