code: def test_durbin_watson():
      # benchmark values from R car::durbinWatsonTest(x)
      # library("car")
      # > durbinWatsonTest(x)
      # [1] 1.95298958377419
      # > durbinWatsonTest(x**2)
      # [1] 1.848802400319998
      # > durbinWatsonTest(x[2:20]+0.5*x[1:19])
      # [1] 1.09897993228779
      # > durbinWatsonTest(x[2:20]+0.8*x[1:19])
      # [1] 0.937241876707273
      # > durbinWatsonTest(x[2:20]+0.9*x[1:19])
      # [1] 0.921488912587806
      st_R = 1.95298958377419
      assert_almost_equal(durbin_watson(x), st_R, 14)
  
      st_R = 1.848802400319998
      assert_almost_equal(durbin_watson(x**2), st_R, 14)
  
      st_R = 1.09897993228779
      assert_almost_equal(durbin_watson(x[1:] + 0.5 * x[:-1]), st_R, 14)
  
      st_R = 0.937241876707273
      assert_almost_equal(durbin_watson(x[1:] + 0.8 * x[:-1]), st_R, 14)
  
      st_R = 0.921488912587806
      assert_almost_equal(durbin_watson(x[1:] + 0.9 * x[:-1]), st_R, 14)
  
      X = np.array([x, x])
      st_R = 1.95298958377419
      assert_almost_equal(
          durbin_watson(X, axis=1), np.array([st_R, st_R]), 14
      )
      assert_almost_equal(
          durbin_watson(X.T, axis=0), np.array([st_R, st_R]), 14
      )
  
imports: import numpy
  import pandas
  from numpy.testing import assert_almost_equal, assert_raises, assert_equal, assert_allclose
  from statsmodels.stats._adnorm import normal_ad
  from statsmodels.stats.stattools import omni_normtest, jarque_bera, durbin_watson, _medcouple_1d, medcouple, robust_kurtosis, robust_skewness
label_desc: Use image node_id 1 for calling a global function with example usage: test_durbin_watson() without return types