code: def call_loss_calculator(data, labels, loss_calculator):
      """Calculates the value of specified custom loss function.
  
      :param neoml.Blob.Blob data: the network response.
  
      :param neoml.Blob.Blob labels: the correct labels.
  
      :param neoml.Dnn.CustomLossCalculatorBase loss_calculator: a user-implemented object
          that provides the method to calculate the custom loss.
      """
      data_blob = Blob.Blob(data)
      labels_blob = Blob.Blob(labels)
  
      loss = loss_calculator.calc(data_blob, labels_blob)
  
      if not type(loss) is Blob.Blob:
          raise ValueError("The result of 'calc' must be neoml.Blob.")
  
      if loss.size != data_blob.object_count:
          raise ValueError(
              "The result of 'calc' must have size == data.object_count."
          )
  
      return loss._internal
  
imports: import neoml.PythonWrapper
  from .Dnn import Layer
  from neoml.Utils import check_input_layers
  from abc import ABCMeta, abstractmethod
  import neoml.Blob
label_desc: Use image node_id 1 for calling a global function with example usage: call_loss_calculator(data, labels, loss_calculator) and returns: loss