code: def test_prefit(boston_train):
      X_train, X_test, y_train, y_test, feat_names = _boston_with_leak(
          *boston_train
      )
  
      # prefit estimator, fit on train part
      reg = RandomForestRegressor(n_estimators=50, random_state=42).fit(
          X_train, y_train
      )
      print(reg.score(X_test, y_test), reg.score(X_train, y_train))
      print(X_train[:, -1], y_train)
      perm_prefit = PermutationImportance(
          reg, random_state=42, n_iter=10
      ).fit(X_train, y_train)
      assert not hasattr(perm_prefit, "estimator_")
      assert perm_prefit.wrapped_estimator_ is reg
      _assert_importances_overfit(perm_prefit, feat_names)
  
      # prefit estimator, fit on test part
      perm_prefit2 = PermutationImportance(
          reg, random_state=42, n_iter=10
      ).fit(X_test, y_test)
      _assert_importances_not_overfit(perm_prefit2, feat_names)
  
imports: import pytest
  import numpy
  from sklearn.base import is_classifier, is_regressor
  from sklearn.svm import SVR, SVC
  from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
  from sklearn.model_selection import train_test_split, cross_val_score
  from sklearn.pipeline import make_pipeline
  from sklearn.feature_selection import SelectFromModel
  from sklearn.linear_model import LogisticRegression
  import eli5
  from eli5.sklearn import PermutationImportance
  from .utils import format_as_all
label_desc: Use image node_id 5 for calling a global function with example usage: test_prefit(boston_train) without return types