code: def test_ctps():
      """Test basic ctps functionality."""
      for ii, (n_trials, j_extent, pk_max) in iter_test_ctps:
          data = get_data(n_trials, j_extent)
          ks_dyn, pk_dyn, phase_trial = ctps(data)
          data2 = _compute_normalized_phase(data)
          ks_dyn2, pk_dyn2, phase_trial2 = ctps(data2, is_raw=False)
          for a, b in zip(
              [ks_dyn, pk_dyn, phase_trial], [ks_dyn2, pk_dyn2, data2]
          ):
              assert_array_equal(a, b)
              assert a.min() >= 0
              assert a.max() <= 1
              assert b.min() >= 0
              assert b.max() <= 1
  
          # test for normalization
          assert (pk_dyn.min() > 0.0) or (pk_dyn.max() < 1.0)
          # test shapes
          assert phase_trial.shape == data.shape
          assert pk_dyn.shape == data.shape[1:]
          # tets ground_truth + random + jittered case
          assert pk_dyn[0].max() == 1.0
          assert len(np.unique(pk_dyn[0])) == 1.0
          assert pk_dyn[1].max() < pk_max
          assert pk_dyn[2].max() > 0.3
          if ii < 1:
              pytest.raises(ValueError, ctps, data[:, :, :, None])
  
      assert _prob_kuiper(1.0, 400) == 1.0
      # test vecrosization
      assert_array_equal(
          _prob_kuiper(np.array([1.0, 1.0]), 400),
          _prob_kuiper(np.array([1.0, 1.0]), 400),
      )
      assert _prob_kuiper(0.1, 400) < 0.1
  
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from mne.preprocessing.ctps_ import _compute_normalized_phase, _prob_kuiper, ctps
  from mne.time_frequency import morlet
label_desc: Use image node_id 2 for calling a global function with example usage: test_ctps() without return types