code: def test_kpss(null):
      test = KPSSTest(alpha=0.05, null=null, lshort=True)
      pval, do_diff = test.should_diff(austres)
      assert do_diff  # show it is significant
      assert_almost_equal(pval, 0.01)
  
      # Test on the data provided in issue #67
      x = np.array([1, -1, 0, 2, -1, -2, 3])
      pval2, do_diff2 = test.should_diff(x)
  
      # We expect Trend to be significant, but NOT Level
      if null == "level":
          assert not do_diff2
          assert_almost_equal(pval2, 0.1)
      else:
          assert do_diff2
          assert_almost_equal(pval2, 0.01)
  
      # test the ndiffs with the KPSS test
      assert ndiffs(austres, test="kpss", max_d=5, null=null) == 2
  
file_path: pmdarima/pmdarima/arima/tests/test_stationarity.py
imports: from pmdarima.arima.stationarity import ADFTest, PPTest, KPSSTest
  from pmdarima.arima.utils import ndiffs
  from pmdarima.utils.array import diff
  from pmdarima.datasets import load_austres
  from sklearn.utils import check_random_state
  from numpy.testing import assert_array_almost_equal, assert_almost_equal, assert_array_equal
  import numpy
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_kpss(null) without return types