code: def exog_to_direct(
      exog: Union[pd.Series, pd.DataFrame], steps: int
  ) -> pd.DataFrame:
      """
      Transforms `exog` to a pandas DataFrame with the shape needed for Direct
      forecasting.
  
      Parameters
      ----------
      exog : pandas Series, pandas DataFrame
          Exogenous variables.
      steps : int.
          Number of steps that will be predicted using exog.
  
      Returns
      -------
      exog_transformed : pandas DataFrame
          Exogenous variables transformed.
  
      """
  
      if not isinstance(exog, (pd.Series, pd.DataFrame)):
          raise TypeError(
              f"`exog` must be a pandas Series or DataFrame. Got {type(exog)}."
          )
  
      if isinstance(exog, pd.Series):
          exog = exog.to_frame()
  
      n_rows = len(exog)
      exog_idx = exog.index
      exog_transformed = []
  
      for i in range(steps):
          exog_column_transformed = exog.iloc[
              i : n_rows - (steps - 1 - i),
          ]
          exog_column_transformed.index = pd.RangeIndex(
              len(exog_column_transformed)
          )
          exog_column_transformed.columns = [
              f"{col}_step_{i+1}"
              for col in exog_column_transformed.columns
          ]
          exog_transformed.append(exog_column_transformed)
  
      if len(exog_transformed) > 1:
          exog_transformed = pd.concat(
              exog_transformed, axis=1, copy=False
          )
      else:
          exog_transformed = exog_column_transformed
  
      exog_transformed.index = exog_idx[-len(exog_transformed) :]
  
      return exog_transformed
  
imports: from typing import Union, Any, Optional, Tuple, Callable
  import warnings
  import importlib
  import joblib
  import numpy
  import pandas
  import sklearn
  import sklearn.pipeline
  import sklearn.linear_model
  from sklearn.compose import ColumnTransformer
  from sklearn.exceptions import NotFittedError
  import inspect
  from copy import deepcopy
  import skforecast
  from ..exceptions import MissingValuesExogWarning
  from ..exceptions import DataTypeWarning
  from ..exceptions import IgnoredArgumentWarning
  from ..exceptions import SkforecastVersionWarning
label_desc: Use image node_id 15 for calling a global function with example usage: exog_to_direct(exog, steps) and returns: exog_transformed