code: def test_dispatch_config_parallel(n_jobs):
      """Check that we properly dispatch the configuration in parallel processing.
  
      Non-regression test for:
      https://github.com/scikit-learn/scikit-learn/issues/25239
      """
      pd = pytest.importorskip("pandas")
      iris = load_iris(as_frame=True)
  
      class TransformerRequiredDataFrame(StandardScaler):
          def fit(self, X, y=None):
              assert isinstance(
                  X, pd.DataFrame
              ), "X should be a DataFrame"
              return super().fit(X, y)
  
          def transform(self, X, y=None):
              assert isinstance(
                  X, pd.DataFrame
              ), "X should be a DataFrame"
              return super().transform(X, y)
  
      dropper = make_column_transformer(
          ("drop", [0]),
          remainder="passthrough",
          n_jobs=n_jobs,
      )
      param_grid = {"randomforestclassifier__max_depth": [1, 2, 3]}
      search_cv = GridSearchCV(
          make_pipeline(
              dropper,
              TransformerRequiredDataFrame(),
              RandomForestClassifier(n_estimators=5, n_jobs=n_jobs),
          ),
          param_grid,
          cv=5,
          n_jobs=n_jobs,
          error_score="raise",  # this search should not fail
      )
  
      # make sure that `fit` would fail in case we don't request dataframe
      with pytest.raises(
          AssertionError, match="X should be a DataFrame"
      ):
          search_cv.fit(iris.data, iris.target)
  
      with config_context(transform_output="pandas"):
          # we expect each intermediate steps to output a DataFrame
          search_cv.fit(iris.data, iris.target)
  
      assert not np.isnan(
          search_cv.cv_results_["mean_test_score"]
      ).any()
  
file_path: scikit-learn/sklearn/utils/tests/test_parallel.py
imports: import time
  import joblib
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn import config_context, get_config
  from sklearn.compose import make_column_transformer
  from sklearn.datasets import load_iris
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.model_selection import GridSearchCV
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils.parallel import Parallel, delayed
label_desc: Use image node_id 4 for calling a global function with example usage: test_dispatch_config_parallel(n_jobs) and returns: super, super