code: def test_pickle():
      """Check pickability"""
  
      # Check the regressor
      est = SymbolicRegressor(
          population_size=100, generations=2, random_state=0
      )
      est.fit(diabetes.data[:100, :], diabetes.target[:100])
      score = est.score(diabetes.data[400:, :], diabetes.target[400:])
      pickle_object = pickle.dumps(est)
  
      est2 = pickle.loads(pickle_object)
      assert type(est2) == est.__class__
      score2 = est2.score(diabetes.data[400:, :], diabetes.target[400:])
      assert score == score2
  
      # Check the transformer
      est = SymbolicTransformer(
          population_size=100, generations=2, random_state=0
      )
      est.fit(diabetes.data[:100, :], diabetes.target[:100])
      X_new = est.transform(diabetes.data[400:, :])
      pickle_object = pickle.dumps(est)
  
      est2 = pickle.loads(pickle_object)
      assert type(est2) == est.__class__
      X_new2 = est2.transform(diabetes.data[400:, :])
      assert_array_almost_equal(X_new, X_new2)
  
      # Check the classifier
      est = SymbolicClassifier(
          population_size=100, generations=2, random_state=0
      )
      est.fit(cancer.data[:100, :], cancer.target[:100])
      score = est.score(cancer.data[500:, :], cancer.target[500:])
      pickle_object = pickle.dumps(est)
  
      est2 = pickle.loads(pickle_object)
      assert type(est2) == est.__class__
      score2 = est2.score(cancer.data[500:, :], cancer.target[500:])
      assert score == score2
  
imports: import pickle
  import pytest
  import sys
  from io import StringIO
  import numpy
  from scipy.stats import pearsonr, spearmanr
  from sklearn.datasets import load_diabetes, load_breast_cancer
  from sklearn.metrics import mean_absolute_error
  from sklearn.model_selection import GridSearchCV
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.utils._testing import assert_almost_equal
  from sklearn.utils._testing import assert_array_equal
  from sklearn.utils._testing import assert_array_almost_equal
  from sklearn.utils._testing import assert_raises
  from sklearn.utils.validation import check_random_state
  from gplearn.genetic import SymbolicClassifier, SymbolicRegressor
  from gplearn.genetic import SymbolicTransformer
  from gplearn.fitness import weighted_pearson, weighted_spearman
  from gplearn._program import _Program
  from gplearn.fitness import _fitness_map
  from gplearn.functions import add2, sub2, mul2, div2, sqrt1, log1, abs1, max2, min2
  from gplearn.functions import _Function
label_desc: Use image node_id 24 for calling a global function with example usage: test_pickle() without return types