code: def metrics_from_model(model):
      msg = "Could not retrieve metrics list from compiled model"
  
      # dep_fix
      if (
          version.parse(tf.__version__) < version.parse("2.2")
          or DISABLE_V2_BEHAVIOR
      ):
          return model._compile_metrics
          # return [m.name for m in model.metrics] if is_tf_keras() else model.metrics
      else:  # TF >= 2.2.0
          mlist = model.compiled_metrics._metrics
          if isinstance(mlist, list) and isinstance(
              mlist[0], str
          ):  # metrics are strings prior to training
              return mlist
          elif isinstance(mlist, list) and isinstance(mlist[0], list):
              try:
                  return [m.name for m in mlist[0]]
              except:
                  warnings.warn(msg)
                  return []
          elif isinstance(mlist, list) and hasattr(
              mlist[0], "name"
          ):  # tf.keras.metrics.AUC()
              try:
                  return [m.name for m in mlist]
              except:
                  warnings.warn(msg)
                  return []
  
          else:
              warnings.warn(msg)
              return []
  
imports: from .imports import *
  from subprocess import Popen
label_desc: Use image node_id 4 for calling a global function with example usage: metrics_from_model(model) and returns: model, mlist, unknown, list, list, unknown, list