code: def eval_reporting(reports, single_node=False):
      """Performance logging independent of who logs what.
  
      Parameters
      ----------
      reports: dict
          Maps metric labels to performance trackers (instances) which need summarise certain fields for final reporting.
      single_node: bool
          Flag for whether/not DDP-gather results (Default: False).
      """
      for log_metric, specs in reports.items():
          if not single_node:
              print(
                  f'{log_metric} on DDP rank {int(os.environ["RANK"])}: {specs["tracker"].summarize()}'
              )
              result_list = [
                  None for _ in range(int(os.environ["WORLD_SIZE"]))
              ]
              # WARNING: https://pytorch.org/docs/stable/distributed.html - underlying `pickle` module is known to be insecure
              torch.distributed.all_gather_object(
                  result_list, specs["tracker"].scores
              )
              specs["tracker"].scores = list()
              for r in result_list:
                  specs["tracker"].scores.extend(r)
          summary = specs["tracker"].summarize()
          print(f"\tSummary: {summary}")
          logger.info(f'{log_metric}: {summary[specs["field"]]}\n')
  
imports: import os
  import sys
  import torch
  import logging
  import speechbrain
  from copy import deepcopy
  from tqdm.contrib import tqdm
  from torch.utils.data import DataLoader
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.inference.ASR import EncoderDecoderASR
  from speechbrain.utils.distributed import run_on_main, ddp_barrier
  from speechbrain.utils.data_utils import batch_pad_right
  from speechbrain.dataio.dataset import DynamicItemDataset
  from speechbrain.dataio.sampler import DynamicBatchSampler
  from speechbrain.dataio.dataloader import LoopedLoader, make_dataloader, distributed_loader_specifics
  from speechbrain.dataio.dataio import read_audio
  from ASR_template_train import ASR, dataio_prepare
label_desc: Use image node_id 1 for calling a global function with example usage: eval_reporting(reports, single_node) without return types