code: def test_x_reformat_1var(exog_format):
      # (10,)
      # (1,10)
      # (n, 10)
      # (1,1,10)
      # (1,n,10)
      # {"x1"} : (10,)
      # {"x1"} : (1,10)
      # {"x1"} : (n,10)
      exog, ref = exog_format
      if exog is None:
          return
      if isinstance(exog, dict):
          nexog = len(exog)
      else:
          if np.ndim(exog) == 3:
              nexog = exog.shape[0]
          else:
              nexog = 1
      cols = [f"x{i}" for i in range(1, nexog + 1)]
      rng = RandomState(12345)
      x = pd.DataFrame(
          rng.standard_normal((SP500.shape[0], nexog)),
          columns=cols,
          index=SP500.index,
      )
      mod = ARX(SP500, lags=1, x=x)
      res = mod.fit()
      fcasts = res.forecast(horizon=10, x=exog)
      ref = res.forecast(horizon=10, x=ref)
      assert_allclose(fcasts.mean, ref.mean)
  
imports: import datetime
  from itertools import product
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose
  import pandas
  from pandas.testing import assert_frame_equal
  import pytest
  from arch.data import sp500
  from arch.tests.univariate.test_variance_forecasting import preserved_state
  from arch.univariate import APARCH, ARX, EGARCH, FIGARCH, GARCH, HARCH, HARX, ConstantMean, ConstantVariance, EWMAVariance, MIDASHyperbolic, RiskMetrics2006, ZeroMean, arch_model
  from arch.univariate.mean import _ar_forecast, _ar_to_impulse
label_desc: Use image node_id 7 for calling a global function with example usage: test_x_reformat_1var(exog_format) without return types