code: def assess_trial(self, trial_job_id, trial_history):
          
          curr_step = len(trial_history)
          if curr_step < self.start_step:
              return AssessResult.Good
  
          try:
              num_trial_history = [float(ele) for ele in trial_history]
          except (TypeError, ValueError) as error:
              logger.warning('incorrect data type or value:')
              logger.exception(error)
          except Exception as error:
              logger.warning('unrecognized exception in medianstop_assessor:')
              logger.excpetion(error)
  
          self._update_data(trial_job_id, num_trial_history)
          if self.high_better:
              best_history = max(trial_history)
          else:
              best_history = min(trial_history)
  
          avg_array = []
          for id in self.completed_avg_history:
              if len(self.completed_avg_history[id]) >= curr_step:
                  avg_array.append(self.completed_avg_history[id][curr_step - 1])
          if len(avg_array) > 0:
              avg_array.sort()
              if self.high_better:
                  median = avg_array[(len(avg_array)-1) // 2]
                  return AssessResult.Bad if best_history < median else AssessResult.Good
              else:
                  median = avg_array[len(avg_array) // 2]
                  return AssessResult.Bad if best_history > median else AssessResult.Good
          else:
              return AssessResult.Good
docs: assess_trial
          
          Parameters
          ----------
          trial_job_id: int
              trial job id
          trial_history: list
              The history performance matrix of each trial
  
          Returns
          -------
          bool
              AssessResult.Good or AssessResult.Bad
  
          Raises
          ------
          Exception
              unrecognize exception in medianstop_assessor