code: def expandarr(x, k):
      # make it work for 2D or nD with axis
      kadd = k
      if np.ndim(x) == 2:
          kadd = (kadd, np.shape(x)[1])
      return np.r_[np.ones(kadd) * x[0], x, np.ones(kadd) * x[-1]]
  
file_path: statsmodels/statsmodels/sandbox/tsa/movstat.py
imports: import numpy
  from scipy import signal
  from numpy.testing import assert_array_equal, assert_array_almost_equal
label_desc: Use image node_id 1 for calling a global function with example usage: expandarr(x, k) and returns: np