docstr: Call assessor to process intermediate results
          
docstr_tok: ["Call","assessor","to","process","intermediate","results"]
code: def _handle_intermediate_metric_data(self, data):
      """Call assessor to process intermediate results"""
      if data["type"] != MetricType.PERIODICAL:
          return
      if self.assessor is None:
          return
  
      trial_job_id = data["trial_job_id"]
      if trial_job_id in _ended_trials:
          return
  
      history = _trial_history[trial_job_id]
      history[data["sequence"]] = data["value"]
      ordered_history = _sort_history(history)
      if (
          len(ordered_history) < data["sequence"]
      ):  # no user-visible update since last time
          return
  
      try:
          result = self.assessor.assess_trial(
              trial_job_id, ordered_history
          )
      except Exception as e:
          _logger.error("Assessor error")
          _logger.exception(e)
          raise
  
      if isinstance(result, bool):
          result = AssessResult.Good if result else AssessResult.Bad
      elif not isinstance(result, AssessResult):
          msg = "Result of Assessor.assess_trial must be an object of AssessResult, not %s"
          raise RuntimeError(msg % type(result))
  
      if result is AssessResult.Bad:
          _logger.debug("BAD, kill %s", trial_job_id)
          self.send(CommandType.KillTrialJob, dump(trial_job_id))
          # notify tuner
          _logger.debug(
              "env var: NNI_INCLUDE_INTERMEDIATE_RESULTS: [%s]",
              dispatcher_env_vars.NNI_INCLUDE_INTERMEDIATE_RESULTS,
          )
          if (
              dispatcher_env_vars.NNI_INCLUDE_INTERMEDIATE_RESULTS
              == "true"
          ):
              self._earlystop_notify_tuner(data)
      else:
          _logger.debug("GOOD")
  
imports: import logging
  from collections import defaultdict
  from nni import NoMoreTrialError
  from nni.assessor import AssessResult
  from .common import multi_phase_enabled
  from .env_vars import dispatcher_env_vars
  from .msg_dispatcher_base import MsgDispatcherBase
  from .tuner_command_channel import CommandType
  from ..common.serializer import dump, load
  from ..utils import MetricType
label_desc: Use image node_id 13 for calling the MsgDispatcher obj's underlying member method code with example usage: obj._handle_intermediate_metric_data(data) without return types