code: def check_if_local_and_lambda(to_dump):
      import re
  
      pred_func = str(to_dump.predict_function)
      res_func = str(to_dump.residual_function)
  
      is_local = "<locals>"
      is_lambda = "<lambda>"
  
      if re.search(is_local, pred_func):
          print(
              "  -> 'predict_function' attribute is a local function; thus, has to be dropped."
          )
          to_dump.predict_function = None
      elif re.search(is_lambda, pred_func):
          print(
              "  -> 'predict_function' attribute is a lambda; thus, has to be dropped."
          )
          to_dump.predict_function = None
      if re.search(is_local, res_func):
          print(
              "  -> 'residual_function' attribute is a local function; thus, has to be dropped."
          )
          to_dump.residual_function = None
      elif re.search(is_lambda, res_func):
          print(
              "  -> 'residual_function' attribute is a lambda; thus, has to be dropped."
          )
          to_dump.residual_function = None
  
      # for R compatibility
      to_dump.model_info["type"] = to_dump.model_type
  
      return to_dump
  
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 13 for calling a global function with example usage: check_if_local_and_lambda(to_dump) and returns: to_dump