code: def test_X_invalid_shape_exception():
      X = np.arange(11.0)
      y = X + 1
      dy = 1
  
      clf = NadarayaWatson(h=0.5).fit(X[:, None], y, dy)
  
      # not valid Xfit.shape[1], should raise an exception
      Xfit = np.array([[4, 5, 6], [1, 2, 3]])
  
      with pytest.raises(Exception) as e:
          clf.predict(Xfit)
  
      assert (
          str(e.value)
          == "dimensions of X do not match training dimension"
      )
  
      # not valid Xfit.shape[1], should raise an exception
      Xfit = np.array([4, 5, 6])
  
      with pytest.raises(Exception) as e:
          clf.predict(Xfit)
  
      assert str(e.value) == "X must be two-dimensional"
  
imports: import numpy
  from numpy.testing import assert_allclose
  import pytest
  from astroML.linear_model import NadarayaWatson
label_desc: Use image node_id 3 for calling a global function with example usage: test_X_invalid_shape_exception() without return types