code: def test_parallel_custom_function():
      """Regression test for running parallel training with custom functions"""
  
      def _logical(x1, x2, x3, x4):
          return np.where(x1 > x2, x3, x4)
  
      logical = make_function(
          function=_logical, name="logical", arity=4
      )
      est = SymbolicRegressor(
          generations=2,
          function_set=["add", "sub", "mul", "div", logical],
          random_state=0,
          n_jobs=2,
      )
      est.fit(diabetes.data, diabetes.target)
      _ = pickle.dumps(est)
  
      # Unwrapped functions should fail
      logical = make_function(
          function=_logical, name="logical", arity=4, wrap=False
      )
      est = SymbolicRegressor(
          generations=2,
          function_set=["add", "sub", "mul", "div", logical],
          random_state=0,
          n_jobs=2,
      )
      est.fit(diabetes.data, diabetes.target)
      assert_raises(AttributeError, pickle.dumps, est)
  
      # Single threaded will also fail in non-interactive sessions
      est = SymbolicRegressor(
          generations=2,
          function_set=["add", "sub", "mul", "div", logical],
          random_state=0,
      )
      est.fit(diabetes.data, diabetes.target)
      assert_raises(AttributeError, pickle.dumps, est)
  
file_path: gplearn/gplearn/tests/test_functions.py
imports: import pickle
  import numpy
  from numpy import maximum
  from sklearn.datasets import load_diabetes, load_breast_cancer
  from sklearn.utils._testing import assert_raises
  from sklearn.utils.validation import check_random_state
  from gplearn.functions import _protected_sqrt, make_function
  from gplearn.genetic import SymbolicRegressor, SymbolicTransformer
  from gplearn.genetic import SymbolicClassifier
label_desc: Use image node_id 3 for calling a global function with example usage: test_parallel_custom_function() and returns: np