code: def check_if_empty_fields(explainer):
      if explainer.predict_function is None:
          print(
              "  -> 'predict_function' is not present, setting to default."
          )
          (
              predict_function,
              model_type,
              y_hat,
              model_info_,
          ) = check_predict_function_and_model_type(
              predict_function=None,
              model_type=explainer.model_type,
              model=explainer.model,
              data=explainer.data,
              model_class=explainer.model_class,
              model_info_=explainer.model_info,
              precalculate=True,
              verbose=False,
          )
          explainer.predict_function = predict_function
          explainer.model_type = model_type
          explainer.y_hat = y_hat
      else:
          model_info_ = {}
      if explainer.residual_function is None:
          print(
              "  -> 'residual_function' is not present, setting to default."
          )
          (
              residual_function,
              residuals,
              model_info,
          ) = check_residual_function(
              residual_function=None,
              predict_function=explainer.predict_function,
              model=explainer.model,
              data=explainer.data,
              y=explainer.y,
              model_info=explainer.model_info,
              precalculate=True,
              verbose=False,
          )
          explainer.residual_function = residual_function
          explainer.residuals = residuals
      else:
          model_info = explainer.model_info
  
      explainer.model_info = check_model_info(
          model_info, model_info_, verbose=False
      )
  
      return explainer
  
imports: import numpy
  import pandas
  from copy import deepcopy
  from warnings import warn
  from .helper import verbose_cat, is_y_in_data, get_model_info
  from .yhat import get_predict_function_and_model_type
label_desc: Use image node_id 14 for calling a global function with example usage: check_if_empty_fields(explainer) and returns: explainer