code: def register_loss(name, external_params=None):
      if external_params is None:
          external_params = []
  
      def insert_in_registry(class_handle):
          LOSS_REGISTRY[name] = class_handle
          class_handle.name = name
          LOSS_REGISTRY[name].external_params = external_params
          return class_handle
  
      return insert_in_registry
  
imports: import abc
  import logging
  import six
  import tensorflow
  from tensorflow.python.keras import metrics
  from tensorflow.python.keras.utils import losses_utils
  from tensorflow.python.ops import math_ops
label_desc: Use image node_id 1 for calling a global function with example usage: register_loss(name, external_params) and returns: insert_in_registry, class_handle