code: def metric_name(metric: dict) -> str:
      """Convert metric labels to standard form."""
      name = metric.get("__name__", "")
      labels = ",".join(
          (
              "{}={}".format(k, json.dumps(v))
              for k, v in metric.items()
              if k != "__name__"
          )
      )
      return "{0}{{{1}}}".format(name, labels)
  
file_path: BigDL/python/chronos/src/bigdl/chronos/data/utils/prometheus_df.py
imports: import datetime
  import json
  from typing import Optional, Union
  from urllib.parse import urljoin
  import numpy
  import pandas
  import requests
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 2 for calling a global function with example usage: metric_name(metric) and returns: str