code: def log_info(step, metrics, mode):
      """
      Log metrics with step and mode information.
  
      Args:
          step(tuple): Step, coulbe (epoch-id, iter-id). Use tuple() for summary.
          metrics(dict): A dictionary collected values of metrics.
          mode(utils.Mode): Train or eval mode.
      """
      prefix = "train" if mode == Mode.TRAIN else "val"
      dllogger_iter_data = dict()
      for key in metrics:
          dllogger_iter_data[f"{prefix}.{key}"] = metrics[key]
      dllogger.log(step=step, data=dllogger_iter_data)
  
imports: import time
  import logging
  from profile import Profiler
  import numpy
  from optimizer import build_optimizer
  from lr_scheduler import build_lr_scheduler
  from utils.misc import AverageMeter
  from utils.mode import Mode, RunScope
  from utils.utility import get_num_trainers
  import models
  import dllogger
  import paddle
  import paddle.nn.functional
  from paddle.distributed import fleet
  from paddle.distributed.fleet import DistributedStrategy
  from paddle.incubate import asp
  from paddle.distributed.fleet.meta_optimizers.common import CollectiveHelper
label_desc: Use image node_id 8 for calling a global function with example usage: log_info(step, metrics, mode) without return types