code: def send_metric(
      self,
      type: Literal["PERIODICAL", "FINAL"],
      parameter_id: int | None,
      trial_job_id: str,
      sequence: int,
      value: TrialMetric,
  ) -> None:
      self._last_metric = {
          "type": type,
          "parameter_id": parameter_id,
          "trial_job_id": trial_job_id,
          "sequence": sequence,
          "value": value,
      }
  
      if type == "PERIODICAL":
          self.intermediates.append(value)
      else:
          self.final = value
  
file_path: nni/test/ut/sdk/helper/trial_command_channel.py
imports: from __future__ import annotations
  import copy
  from typing_extensions import Literal
  from nni.runtime.trial_command_channel import TrialCommandChannel
  from nni.typehint import TrialMetric, ParameterRecord
label_desc: Use image node_id 5 for calling the TestHelperTrialCommandChannel obj's underlying member method code with example usage: obj.send_metric(type, parameter_id, trial_job_id, sequence, value) without return types