code: def deserialize_loss(loss):
      if isinstance(loss, list):
          return loss[0]
      return keras.losses.deserialize(loss)
  
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 4 for calling a global function with example usage: deserialize_loss(loss) and returns: keras, loss