code: def _log_metrics(
      model: BasePipeline,
      logger: LightningLoggerBase,
      metric_list: List[Union[Callable[..., Any], Metric]],
      all_scores: List[float],
      verbose: bool,
  ):
      try:
          step = model.hparams.get("num_epochs_completed")
      except torch.nn.modules.module.ModuleAttributeError:
          # if, somehow, there is no ``model.hparams`` attribute, this shouldn't fail
          step = None
  
      try:
          metrics_dict = dict(
              zip([x.__name__ for x in metric_list], all_scores)
          )
      except AttributeError:
          metrics_dict = dict(
              zip([type(x).__name__ for x in metric_list], all_scores)
          )
  
      if verbose:
          print(f"Logging metrics {metrics_dict} to ``logger``...")
  
      logger.log_metrics(metrics=metrics_dict, step=step)
  
imports: from typing import Any, Callable, Iterable, List, Optional, Tuple, Union
  import warnings
  import numpy
  from scipy.sparse import csr_matrix
  import torch
  from torchmetrics import Metric
  from torchmetrics.functional import auroc
  from tqdm.auto import tqdm
  import collie
  from collie.interactions import ExplicitInteractions, Interactions, InteractionsDataLoader
  from collie.model import BasePipeline
label_desc: Use image node_id 10 for calling a global function with example usage: _log_metrics(model, logger, metric_list, all_scores, verbose) without return types