code: def send_metric(
      self,
      type: Literal[
          "PERIODICAL", "FINAL"
      ],  # pylint: disable=redefined-builtin
      parameter_id: int | None,
      trial_job_id: str,
      sequence: int,
      value: TrialMetric,
  ) -> None:
      if type == "PERIODICAL":
          self.engine.dispatch_model_event(
              IntermediateMetricEvent(self.model, value)
          )
      elif type == "FINAL":
          self.engine.dispatch_model_event(
              FinalMetricEvent(self.model, value)
          )
      else:
          raise ValueError(f"Unknown metric type: {type}")
  
imports: from __future__ import annotations
  import logging
  import time
  import traceback
  from typing import Iterable, List, cast
  from typing_extensions import Literal
  import nni
  from nni.runtime.trial_command_channel import set_default_trial_command_channel, get_default_trial_command_channel, TrialCommandChannel
  from nni.nas.space import ExecutableModelSpace, ModelStatus
  from nni.typehint import ParameterRecord, Parameters, TrialMetric
  from .engine import ExecutionEngine
  from .event import FinalMetricEvent, IntermediateMetricEvent, TrainingEndEvent
label_desc: Use image node_id 3 for calling the SequentialTrialCommandChannel obj's underlying member method code with example usage: obj.send_metric(type, parameter_id, trial_job_id, sequence, value) without return types