code: def test_bootstrap_isc():
      # Set parameters for toy time series data
      n_subjects = 20
      n_TRs = 60
      n_voxels = 30
      random_state = 42
      n_bootstraps = 10
  
      logger.info("Testing bootstrap hypothesis test")
  
      data = simulated_timeseries(
          n_subjects,
          n_TRs,
          n_voxels=n_voxels,
          data_type="array",
          random_state=random_state,
      )
  
      iscs = isc(data, pairwise=False, summary_statistic=None)
      observed, ci, p, distribution = bootstrap_isc(
          iscs,
          pairwise=False,
          summary_statistic="median",
          n_bootstraps=n_bootstraps,
          ci_percentile=95,
      )
      assert distribution.shape == (n_bootstraps, n_voxels)
  
      # Test one-sample bootstrap test with pairwise approach
      n_bootstraps = 10
  
      iscs = isc(data, pairwise=True, summary_statistic=None)
      observed, ci, p, distribution = bootstrap_isc(
          iscs,
          pairwise=True,
          summary_statistic="median",
          n_bootstraps=n_bootstraps,
          ci_percentile=95,
      )
      assert distribution.shape == (n_bootstraps, n_voxels)
  
      # Check random seeds
      iscs = isc(data, pairwise=False, summary_statistic=None)
      distributions = []
      for random_state in [42, 42, None]:
          observed, ci, p, distribution = bootstrap_isc(
              iscs,
              pairwise=False,
              summary_statistic="median",
              n_bootstraps=n_bootstraps,
              ci_percentile=95,
              random_state=random_state,
          )
          distributions.append(distribution)
      assert np.array_equal(distributions[0], distributions[1])
      assert not np.array_equal(distributions[1], distributions[2])
  
      # Check output p-values
      data = correlated_timeseries(20, 60, noise=0.5, random_state=42)
      iscs = isc(data, pairwise=False)
      observed, ci, p, distribution = bootstrap_isc(
          iscs, 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
      print(p)
  
      iscs = isc(data, pairwise=True)
      observed, ci, p, distribution = bootstrap_isc(iscs, 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 bootstrap observed are same
      iscs = isc(data, pairwise=False)
      observed, ci, p, distribution = bootstrap_isc(
          iscs, pairwise=False, summary_statistic="median"
      )
      assert np.array_equal(
          observed,
          isc(data, pairwise=False, summary_statistic="median"),
      )
  
      # Check that ISC computation and bootstrap observed are same
      iscs = isc(data, pairwise=True)
      observed, ci, p, distribution = bootstrap_isc(
          iscs, pairwise=True, summary_statistic="median"
      )
      assert np.array_equal(
          observed, isc(data, pairwise=True, summary_statistic="median")
      )
  
      logger.info("Finished testing bootstrap hypothesis test")
  
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 7 for calling a global function with example usage: test_bootstrap_isc() without return types