code: def test_print_overloading_estimator():
      """Check that printing a fitted estimator results in 'pretty' output"""
  
      random_state = check_random_state(415)
      X = np.reshape(random_state.uniform(size=50), (5, 10))
      y = random_state.uniform(size=5)
  
      # Check the regressor
      est = SymbolicRegressor(
          population_size=100, generations=2, random_state=0
      )
  
      # Unfitted
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est)
          output_unfitted = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      # Fitted
      est.fit(X, y)
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est)
          output_fitted = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est._program)
          output_program = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      assert output_unfitted != output_fitted
      assert output_unfitted == est.__repr__()
      assert output_fitted == output_program
  
      # Check the transformer
      est = SymbolicTransformer(
          population_size=100, generations=2, random_state=0
      )
  
      # Unfitted
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est)
          output_unfitted = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      # Fitted
      est.fit(X, y)
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est)
          output_fitted = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          output = str([gp.__str__() for gp in est])
          print(output.replace("',", ",\n").replace("'", ""))
          output_program = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      assert output_unfitted != output_fitted
      assert output_unfitted == est.__repr__()
      assert output_fitted == output_program
  
      # Check the classifier
      y = (y > 0.5).astype(int)
      est = SymbolicClassifier(
          population_size=100, generations=2, random_state=0
      )
  
      # Unfitted
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est)
          output_unfitted = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      # Fitted
      est.fit(X, y)
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est)
          output_fitted = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      orig_stdout = sys.stdout
      try:
          out = StringIO()
          sys.stdout = out
          print(est._program)
          output_program = out.getvalue().strip()
      finally:
          sys.stdout = orig_stdout
  
      assert output_unfitted != output_fitted
      assert output_unfitted == est.__repr__()
      assert output_fitted == output_program
  
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 29 for calling a global function with example usage: test_print_overloading_estimator() without return types