code: def log_metrics(
      lrs: Union[List, float],
      log_writer,
      train_loss: float,
      val_loss: float,
      epoch: int,
      best_metric: float,
      val_ema_loss: Optional[float] = None,
      ckpt_metric_name: Optional[str] = None,
      train_ckpt_metric: Optional[float] = None,
      val_ckpt_metric: Optional[float] = None,
      val_ema_ckpt_metric: Optional[float] = None,
  ) -> None:
      if not isinstance(lrs, list):
          lrs = [lrs]
      for g_id, lr_val in enumerate(lrs):
          log_writer.add_scalar(
              "LR/Group-{}".format(g_id), round(lr_val, 6), epoch
          )
  
      log_writer.add_scalar(
          "Common/Best Metric", round(best_metric, 2), epoch
      )
  
file_path: ml-cvnets/engine/utils.py
imports: import argparse
  from typing import Dict, List, Optional, Union
  import torch
  from torch import Tensor
  from torch.cuda.amp import autocast
  from utils import logger
  from utils.common_utils import create_directories
  from utils.ddp_utils import is_master
label_desc: Use image node_id 3 for calling a global function with example usage: log_metrics(lrs, log_writer, train_loss, val_loss, epoch, best_metric, val_ema_loss, ckpt_metric_name, train_ckpt_metric, val_ckpt_metric, val_ema_ckpt_metric) without return types