code: def test_phaseshift_isc():
      # Set parameters for toy time series data
      n_subjects = 20
      n_TRs = 60
      n_voxels = 30
  
      logger.info("Testing phase randomization")
  
      data = simulated_timeseries(
          n_subjects, n_TRs, n_voxels=n_voxels, data_type="array"
      )
      observed, p, distribution = phaseshift_isc(
          data, pairwise=True, summary_statistic="median", n_shifts=200
      )
  
      # Phase randomization one-sample test, leave-one-out
      data = simulated_timeseries(
          n_subjects, n_TRs, n_voxels=n_voxels, data_type="array"
      )
      observed, p, distribution = phaseshift_isc(
          data, pairwise=False, summary_statistic="mean", n_shifts=200
      )
  
      # Check output p-values
      data = correlated_timeseries(20, 60, noise=0.5, random_state=42)
      iscs = isc(data, pairwise=False)
      observed, p, distribution = phaseshift_isc(data, pairwise=False)
      assert np.all(iscs[:, :2] > 0.5)
      assert np.all(iscs[:, -1] < 0.5)
      assert p[0] < 0.05 and p[1] < 0.05
      assert p[2] > 0.01
  
      iscs = isc(data, pairwise=True)
      observed, p, distribution = phaseshift_isc(data, pairwise=True)
      assert np.all(iscs[:, :2] > 0.5)
      assert np.all(iscs[:, -1] < 0.5)
      assert p[0] < 0.05 and p[1] < 0.05
      assert p[2] > 0.01
  
      # Check that ISC computation and permutation observed are same
      iscs = isc(data, pairwise=False)
      observed, p, distribution = phaseshift_isc(
          data, pairwise=False, summary_statistic="median"
      )
      assert np.allclose(
          observed,
          isc(data, pairwise=False, summary_statistic="median"),
          rtol=1e-03,
      )
  
      # Check that ISC computation and permuation observed are same
      iscs = isc(data, pairwise=True)
      observed, p, distribution = phaseshift_isc(
          data, pairwise=True, summary_statistic="mean"
      )
      assert np.allclose(
          observed,
          isc(data, pairwise=True, summary_statistic="mean"),
          rtol=1e-03,
      )
  
      logger.info("Finished testing phase randomization")
  
file_path: brainiak/tests/isc/test_isc.py
imports: import numpy
  import logging
  import pytest
  from brainiak.isc import isc, isfc, bootstrap_isc, permutation_isc, squareform_isfc, timeshift_isc, phaseshift_isc
  from scipy.spatial.distance import squareform
label_desc: Use image node_id 10 for calling a global function with example usage: test_phaseshift_isc() without return types