code: def serialize(metric):
      """Serializes metric function or `Metric` instance.
  
      Args:
          metric: A Keras `Metric` instance or a metric function.
  
      Returns:
          Metric configuration dictionary.
      """
      return serialization_lib.serialize_keras_object(metric)
  
imports: import inspect
  from keras.api_export import keras_export
  from keras.metrics.accuracy_metrics import Accuracy
  from keras.metrics.accuracy_metrics import BinaryAccuracy
  from keras.metrics.accuracy_metrics import CategoricalAccuracy
  from keras.metrics.accuracy_metrics import SparseCategoricalAccuracy
  from keras.metrics.accuracy_metrics import SparseTopKCategoricalAccuracy
  from keras.metrics.accuracy_metrics import TopKCategoricalAccuracy
  from keras.metrics.confusion_metrics import AUC
  from keras.metrics.confusion_metrics import FalseNegatives
  from keras.metrics.confusion_metrics import FalsePositives
  from keras.metrics.confusion_metrics import Precision
  from keras.metrics.confusion_metrics import PrecisionAtRecall
  from keras.metrics.confusion_metrics import Recall
  from keras.metrics.confusion_metrics import RecallAtPrecision
  from keras.metrics.confusion_metrics import SensitivityAtSpecificity
  from keras.metrics.confusion_metrics import SpecificityAtSensitivity
  from keras.metrics.confusion_metrics import TrueNegatives
  from keras.metrics.confusion_metrics import TruePositives
  from keras.metrics.f_score_metrics import F1Score
  from keras.metrics.f_score_metrics import FBetaScore
  from keras.metrics.hinge_metrics import CategoricalHinge
  from keras.metrics.hinge_metrics import Hinge
  from keras.metrics.hinge_metrics import SquaredHinge
  from keras.metrics.iou_metrics import BinaryIoU
  from keras.metrics.iou_metrics import IoU
  from keras.metrics.iou_metrics import MeanIoU
  from keras.metrics.iou_metrics import OneHotIoU
  from keras.metrics.iou_metrics import OneHotMeanIoU
  from keras.metrics.metric import Metric
  from keras.metrics.probabilistic_metrics import BinaryCrossentropy
  from keras.metrics.probabilistic_metrics import CategoricalCrossentropy
  from keras.metrics.probabilistic_metrics import KLDivergence
  from keras.metrics.probabilistic_metrics import Poisson
  from keras.metrics.probabilistic_metrics import SparseCategoricalCrossentropy
  from keras.metrics.reduction_metrics import Mean
  from keras.metrics.reduction_metrics import MeanMetricWrapper
  from keras.metrics.reduction_metrics import Sum
  from keras.metrics.regression_metrics import CosineSimilarity
  from keras.metrics.regression_metrics import LogCoshError
  from keras.metrics.regression_metrics import MeanAbsoluteError
  from keras.metrics.regression_metrics import MeanAbsolutePercentageError
  from keras.metrics.regression_metrics import MeanSquaredError
  from keras.metrics.regression_metrics import MeanSquaredLogarithmicError
  from keras.metrics.regression_metrics import R2Score
  from keras.metrics.regression_metrics import RootMeanSquaredError
  from keras.saving import serialization_lib
  from keras.utils.naming import to_snake_case
label_desc: Use image node_id 1 for calling a global function with example usage: serialize(metric) and returns: serialization_lib