code: def test_exog_to_direct_when_steps_2_exog_1d_category():
      """
      Test exog_to_direct results when using steps 2 and exog is a
      1d pandas Series or 1 column DataFrame of category.
      """
      exog = pd.Series(range(10), name="exog", dtype="category")
      results = exog_to_direct(exog=exog, steps=2)
      expected = pd.DataFrame(
          {
              "exog_step_1": pd.Categorical(
                  range(9), categories=range(10)
              ),
              "exog_step_2": pd.Categorical(
                  range(1, 10), categories=range(10)
              ),
          },
          index=pd.RangeIndex(start=1, stop=10, step=1),
      )
  
      pd.testing.assert_frame_equal(results, expected)
  
file_path: skforecast/skforecast/utils/tests/test_exog_to_direct.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.utils import exog_to_direct
  from pandas.api.types import CategoricalDtype
label_desc: Use image node_id 5 for calling a global function with example usage: test_exog_to_direct_when_steps_2_exog_1d_category() without return types