code: def get(identifier, hyperparams={}):
      """
      Get the loss function specified by the identifier.
  
      Parameters
      ----------
      identifier: Loss class instance or str or function handle
          Instance of Loss class (Pairwise, NLLLoss, etc.), name of the (existing) loss function to be used
          (with default parameters) or handle to the function which takes in two parameters (signature:
          def loss_fn(scores_pos, scores_neg)).
  
      Returns
      -------
      loss: Loss class instance
          Loss function.
  
      Example
      -------
      >>> import ampligraph.latent_features.loss_functions as lfs
      >>> nll_loss = lfs.get('nll')
      >>> isinstance(udf_loss, Loss)
      True
  
      >>> def user_defined_loss(scores_pos, scores_neg):
      >>>    neg_exp = tf.exp(scores_neg)
      >>>    pos_exp = tf.exp(scores_pos)
      >>>    softmax_score = pos_exp / (tf.reduce_sum(neg_exp, axis=0) + pos_exp)
      >>>    loss = -tf.math.log(softmax_score)
      >>>    return loss
      >>> udf_loss = lfs.get(user_defined_loss)
      >>> isinstance(udf_loss, Loss)
      True
      """
      if isinstance(identifier, Loss):
          return identifier
      elif isinstance(identifier, six.string_types):
          if identifier not in LOSS_REGISTRY.keys():
              raise ValueError(
                  "Could not interpret loss identifier:", identifier
              )
          return LOSS_REGISTRY.get(identifier)(hyperparams)
      elif callable(identifier):
          loss_name = identifier.__name__
          wrapped_callable = LossFunctionWrapper(identifier, loss_name)
          return wrapped_callable
      else:
          raise ValueError(
              "Could not interpret loss identifier:", identifier
          )
  
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 3 for calling a global function with example usage: get(identifier, hyperparams) and returns: identifier, LOSS_REGISTRY, wrapped_callable