code: def serialize_metrics(metrics):
      serialized = []
      for metric in metrics:
          if isinstance(metric, str):
              serialized.append([metric])
          else:
              serialized.append(keras.metrics.serialize(metric))
      return serialized
  
file_path: autokeras/autokeras/engine/head.py
imports: from typing import Optional
  from tensorflow import keras
  from autokeras.engine import io_hypermodel
  from autokeras.utils import types
label_desc: Use image node_id 1 for calling a global function with example usage: serialize_metrics(metrics) and returns: serialized