code: def check_method_loss_function(explainer, loss_function):
      if loss_function is not None:
          # user passed a function
          return loss_function
      elif explainer.model_type is None:
          # type is not known
          return "rmse"
      elif explainer.model_type == "regression":
          return "rmse"
      elif explainer.model_type == "classification":
          return "1-auc"
  
imports: from dalex.model_explanations._variable_importance.loss_functions import *
  from dalex.model_explanations._model_performance.utils import *
label_desc: Use image node_id 3 for calling a global function with example usage: check_method_loss_function(explainer, loss_function) and returns: loss_function, str, str, str