code: def test_level_shift_ad():
      model = LevelShiftAD(window=3)
      s_train = s.copy().iloc[:-10]
      model.fit(s_train)
  
      s_test = s.copy().iloc[-5:]
      s_test.iloc[-3:] = 10
      pd.testing.assert_series_equal(
          model.predict(s_test),
          pd.Series([np.nan] * 5, index=s_test.index),
      )
  
      s_test = s.copy().iloc[-6:]
      s_test.iloc[-3:] = 10
      pd.testing.assert_series_equal(
          model.predict(s_test),
          pd.Series(
              [np.nan] * 3 + [1.0] + [np.nan] * 2, index=s_test.index
          ),
      )
  
imports: import numpy
  import pandas
  from adtk.detector import AutoregressionAD, LevelShiftAD, PersistAD, VolatilityShiftAD
label_desc: Use image node_id 2 for calling a global function with example usage: test_level_shift_ad() without return types