class_docstr: The median stopping rule stops a pending trial X at step S
  if the trial’s best objective value by step S is strictly worse than the median value
  of the running averages of all completed trials’ objectives reported up to step S
  
  Paper: `Google Vizer: A Service for Black-Box Optimization
  <https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/46180.pdf>`__
  
  Examples
  --------
  
  .. code-block::
  
      config.assessor.name = 'Medianstop'
      config.assessor.class_args = {
          'optimize_mode': 'maximize',
          'start_step': 5
      }
  
  Parameters
  ----------
  optimize_mode
      Whether optimize to minimize or maximize trial result.
  start_step
      A trial is determined to be stopped or not
      only after receiving start_step number of reported intermediate results.
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 exist in running_history"
          )
  
file_path: nni/nni/algorithms/hpo/medianstop_assessor.py
imports: from __future__ import annotations
  import logging
  from schema import Schema, Optional
  from typing_extensions import Literal
  from nni import ClassArgsValidator
  from nni.assessor import Assessor, AssessResult
  from nni.utils import extract_scalar_history
label_desc: Use image node_id 3 for calling the MedianstopAssessor obj's underlying member method code with example usage: obj.trial_end(trial_job_id, success) without return types