code: def test_mvpa_voxel_selection():
      data = prng.rand(5, 5, 5, 8).astype(np.float32)
      # all MPI processes read the mask; the mask file is small
      mask = np.ones([5, 5, 5], dtype=bool)
      mask[0, 0, :] = False
      labels = [0, 1, 0, 1, 0, 1, 0, 1]
      # 2 subjects, 4 epochs per subject
      sl = Searchlight(sl_rad=1)
      mvs = MVPAVoxelSelector(data, mask, labels, 2, sl)
      # for cross validation, use SVM with precomputed kernel
  
      clf = svm.SVC(kernel="rbf", C=10, gamma="auto")
      result_volume, results = mvs.run(clf)
      if MPI.COMM_WORLD.Get_rank() == 0:
          output = []
          for tuple in results:
              if tuple[1] > 0:
                  output.append(int(8 * tuple[1]))
          expected_output = [
              6,
              6,
              5,
              5,
              5,
              5,
              5,
              5,
              5,
              4,
              4,
              4,
              4,
              4,
              4,
              4,
              4,
              3,
              3,
              3,
              3,
              3,
              2,
              2,
              2,
              1,
          ]
          assert np.allclose(
              output, expected_output, atol=1
          ), "voxel selection via SVM does not provide correct results"
  
file_path: brainiak/tests/fcma/test_mvpa_voxel_selection.py
imports: import conftest
  from brainiak.fcma.mvpa_voxelselector import MVPAVoxelSelector
  from brainiak.searchlight.searchlight import Searchlight
  from sklearn import svm
  import numpy
  from mpi4py import MPI
  from numpy.random import RandomState
label_desc: Use image node_id 1 for calling a global function with example usage: test_mvpa_voxel_selection() without return types