code: def test_create_train_X_y_output_when_y_is_series_10_and_exog_is_dataframe_of_category():
      """
      Test the output of create_train_X_y when y=pd.Series(np.arange(10)) and
      exog is a pandas dataframe with two columns of category.
      """
      y = pd.Series(np.arange(10), dtype=float)
      exog = pd.DataFrame(
          {
              "exog_1": pd.Categorical(range(10)),
              "exog_2": pd.Categorical(range(100, 110)),
          }
      )
      forecaster = ForecasterAutoregCustom(
          regressor=LinearRegression(),
          fun_predictors=create_predictors,
          window_size=5,
      )
      results = forecaster.create_train_X_y(y=y, exog=exog)
      expected = (
          pd.DataFrame(
              data=np.array(
                  [
                      [4.0, 3.0, 2.0, 1.0, 0.0],
                      [5.0, 4.0, 3.0, 2.0, 1.0],
                      [6.0, 5.0, 4.0, 3.0, 2.0],
                      [7.0, 6.0, 5.0, 4.0, 3.0],
                      [8.0, 7.0, 6.0, 5.0, 4.0],
                  ]
              ),
              index=pd.RangeIndex(start=5, stop=10, step=1),
              columns=[
                  "custom_predictor_0",
                  "custom_predictor_1",
                  "custom_predictor_2",
                  "custom_predictor_3",
                  "custom_predictor_4",
              ],
          ).assign(
              exog_1=pd.Categorical(range(5, 10), categories=range(10)),
              exog_2=pd.Categorical(
                  range(105, 110), categories=range(100, 110)
              ),
          ),
          pd.Series(
              data=np.array([5, 6, 7, 8, 9]),
              index=pd.RangeIndex(start=5, stop=10, step=1),
              name="y",
              dtype=float,
          ),
      )
  
      pd.testing.assert_frame_equal(results[0], expected[0])
      pd.testing.assert_series_equal(results[1], expected[1])
  
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from skforecast.preprocessing import TimeSeriesDifferentiator
  from skforecast.exceptions import MissingValuesExogWarning
  from sklearn.linear_model import LinearRegression
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import StandardScaler
  from sklearn.preprocessing import OneHotEncoder
  from .fixtures_ForecasterAutoregCustom import data
label_desc: Use image node_id 18 for calling a global function with example usage: test_create_train_X_y_output_when_y_is_series_10_and_exog_is_dataframe_of_category() without return types