code: def prepare_exog(exog):
      k_exog = 0
      if exog is not None:
          exog_is_using_pandas = _is_using_pandas(exog, None)
          if not exog_is_using_pandas:
              exog = np.asarray(exog)
  
          # Make sure we have 2-dimensional array
          if exog.ndim == 1:
              if not exog_is_using_pandas:
                  exog = exog[:, None]
              else:
                  exog = pd.DataFrame(exog)
  
          k_exog = exog.shape[1]
      return (k_exog, exog)
  
imports: import numpy
  from scipy.linalg import solve_sylvester
  import pandas
  from statsmodels.compat.pandas import Appender
  from statsmodels.tools.data import _is_using_pandas
  from scipy.linalg.blas import find_best_blas_type
  from .None import _initialization, _representation, _kalman_filter, _kalman_smoother, _simulation_smoother, _cfa_simulation_smoother, _tools
label_desc: Use image node_id 28 for calling a global function with example usage: prepare_exog(exog) and returns: k_exog,  exog