code: def _remove_metric_prefix(metric):
      """Format the string metric to remove prefix."""
      if isinstance(metric, (list, tuple)):
          metrics = []
          for target_metric in metric:
              if target_metric == "latency":
                  metrics.append(target_metric)
              else:
                  metrics.append(_remove_metric_prefix(target_metric))
          return metrics
      if isinstance(metric, str):
          if "/" in metric:
              metric = metric.split("/")[-1]
          return metric
  
imports: from typing import Any
  import torch
  import time
  from pytorch_lightning.callbacks import Callback
  from pytorch_lightning.loops.dataloader.evaluation_loop import EvaluationLoop
  from bigdl.nano.utils.common import invalidInputError
  from collections import ChainMap
  from torchmetrics import Metric
label_desc: Use image node_id 2 for calling a global function with example usage: _remove_metric_prefix(metric) and returns: metrics, metric