code: def _format_metric_str(prefix, metric):
      """Format the string metric."""
      if isinstance(metric, (list, tuple)):
          metrics = []
          for target_metric in metric:
              if target_metric == "latency":
                  metrics.append(target_metric)
              else:
                  metrics.append(
                      _format_metric_str(prefix, target_metric)
                  )
          return metrics
      if isinstance(metric, str):
          from bigdl.chronos.metric.forecast_metrics import (
              REGRESSION_MAP,
          )
  
          metric_func = REGRESSION_MAP.get(metric, None)
          invalidInputError(
              metric_func is not None,
              "{} is not found in available metrics.".format(metric),
          )
      return _format_metric(prefix, metric_func)
  
imports: from bigdl.nano.pytorch.lightning import LightningModule
  from bigdl.nano.utils.common import invalidInputError
  from typing import List
  import pytorch_lightning
  from torchmetrics.metric import Metric
  from torch.optim.lr_scheduler import _LRScheduler
  import bigdl.nano.automl.hpo
  import warnings
  import torch
  import inspect
  from torch import nn, Tensor, fx
  from torch.utils.data import TensorDataset, DataLoader
  from bigdl.nano.automl.hpo.space import Space
label_desc: Use image node_id 3 for calling a global function with example usage: _format_metric_str(prefix, metric) and returns: _format_metric, metrics