code: def init_metric_results(
      self,
      thread_id,
      metric_names,
      metric_types,
      metric_dtypes,
      save_path,
      worker_id,
  ):
      metric_results = []
      for m_idx in range(len(metric_names)):
          metric_name, metric_type, metric_dtype = (
              metric_names[m_idx],
              metric_types[m_idx],
              metric_dtypes[m_idx],
          )
          assert metric_dtype not in [
              np.float64,
              np.double,
          ], "Currently floating point metric values are not supported. Please change your metric into integer values (and potentially multiply a larger coefficient to keep the precision)."
          metric_save_path = f"{save_path}/{metric_name}/worker{worker_id}_thread{thread_id}/"
          os.makedirs(metric_save_path, exist_ok=True)
          if metric_type == "single_value_per_sample":
              sample_to_metric_fname = (
                  f"{metric_save_path}/{metric_name}_sample_to_metric"
              )
              sample_to_metric_builder = create_mmap_dataset_builder(
                  sample_to_metric_fname, metric_dtype
              )
              metric_to_sample_fname = (
                  f"{metric_save_path}/{metric_name}_metric_to_sample"
              )
              os.system(f"rm -rf {metric_to_sample_fname}*")
              metric_to_sample_dict = defaultdict(list)
              metric_results.append(
                  {
                      "sample_to_metric_fname": sample_to_metric_fname,
                      "sample_to_metric_builder": sample_to_metric_builder,
                      "metric_to_sample_fname": metric_to_sample_fname,
                      "metric_to_sample_dict": metric_to_sample_dict,
                  }
              )
          elif metric_type == "accumulate_value_over_samples":
              metric_value = None
              metric_value_fname = (
                  f"{metric_save_path}/{metric_name}_metric_value"
              )
              metric_results.append(
                  {
                      "metric_value": metric_value,
                      "metric_value_fname": metric_value_fname,
                  }
              )
      return metric_results
  
imports: import os
  from collections import defaultdict
  import csv
  import time
  from multiprocessing import Process, Manager
  import numpy
  import torch
  from torch.utils.data import BatchSampler, SequentialSampler, DataLoader, Subset
  from deepspeed.utils import logger
  from .indexed_dataset import MMapIndexedDataset
  from .utils import split_dataset, split_index, create_mmap_dataset_builder, close_mmap_dataset_builder, find_fit_int_dtype
label_desc: Use image node_id 2 for calling the DataAnalyzer obj's underlying member method code with example usage: obj.init_metric_results(thread_id, metric_names, metric_types, metric_dtypes, save_path, worker_id) and returns: metric_results