code: def test_sklearn_ohe_with_crossvalidation():
      """
      Created 2022-02-14 to test fix to issue # 368
      """
  
      # Set up test pipeline with wrapped OneHotEncoder, with simple regression model
      # to be able to run cross-validation; use sklearn CA housing data
      df = fetch_california_housing(as_frame=True).frame
      y = df["MedHouseVal"]
      X = (
          df[["HouseAge", "AveBedrms"]]
          .assign(
              AveBedrms_cat=lambda x: pd.cut(
                  x.AveBedrms, [0, 1, 2, 3, 4, np.inf]
              ).astype(str)
          )
          .drop(columns="AveBedrms")
      )
      pipeline: Pipeline = Pipeline(
          steps=[
              (
                  "encode_cat",
                  SklearnTransformerWrapper(
                      transformer=OneHotEncoder(
                          drop="first", sparse=False
                      ),
                      variables=["AveBedrms_cat"],
                  ),
              ),
              ("model", Lasso()),
          ]
      )
  
      # Run cross-validation
      results: np.ndarray = cross_val_score(
          pipeline, X, y, scoring="neg_mean_squared_error", cv=3
      )
      assert not any([np.isnan(i) for i in results])
  
imports: import numpy
  import pandas
  import pytest
  from sklearn.base import clone
  from sklearn.datasets import fetch_california_housing
  from sklearn.decomposition import PCA
  from sklearn.ensemble import RandomForestClassifier, VotingClassifier
  from sklearn.feature_selection import RFE, SelectFromModel, SelectKBest, VarianceThreshold, f_regression
  from sklearn.impute import MissingIndicator, SimpleImputer
  from sklearn.linear_model import Lasso
  from sklearn.model_selection import cross_val_score
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import Binarizer, FunctionTransformer, KBinsDiscretizer, MinMaxScaler, Normalizer, OneHotEncoder, OrdinalEncoder, PolynomialFeatures, PowerTransformer, StandardScaler
  from feature_engine.wrappers import SklearnTransformerWrapper
label_desc: Use image node_id 15 for calling a global function with example usage: test_sklearn_ohe_with_crossvalidation() without return types