code: def get_metric_results(self, metrics):
      intermediate_result = {}
      final_result = {}
      for metric in metrics:
          # metrics value are encoded by NNI SDK as json string,
          # here we decode the value by json.loads twice
          metric_value = json.loads(json.loads(metric["data"]))
          if metric["type"] == "PERIODICAL":
              if metric["trialJobId"] in intermediate_result:
                  intermediate_result[metric["trialJobId"]].append(
                      metric_value
                  )
              else:
                  intermediate_result[metric["trialJobId"]] = [
                      metric_value
                  ]
          elif metric["type"] == "FINAL":
              if metric["trialJobId"] in final_result:
                  final_result[metric["trialJobId"]].append(
                      metric_value
                  )
              else:
                  final_result[metric["trialJobId"]] = [metric_value]
      return intermediate_result, final_result
  
imports: import os.path
  from os import remove
  import subprocess
  import json
  import requests
  from nni.experiment import Experiment
  from nni.tools.nnictl.updater import load_imported_data
  from utils import METRICS_URL, GET_IMPORTED_DATA_URL
label_desc: Use image node_id 3 for calling the MetricsValidator obj's underlying member method code with example usage: obj.get_metric_results(metrics) and returns: intermediate_result,  final_result