code: def _do_cross_validation(self, clf, data, task):
          
          time1 = time.time()
  
          if isinstance(clf, sklearn.svm.SVC) and clf.kernel == 'precomputed'\
                  and self.use_multiprocessing:
              inlist = [(clf, i + task[0], self.num_folds, data[i, :, :],
                         self.labels) for i in range(task[1])]
  
              with multiprocessing.Pool(self.process_num) as pool:
                  results = list(pool.starmap(_cross_validation_for_one_voxel,
                                              inlist))
          else:
              results = []
              for i in range(task[1]):
                  result = _cross_validation_for_one_voxel(clf, i + task[0],
                                                           self.num_folds,
                                                           data[i, :, :],
                                                           self.labels)
                  results.append(result)
          time2 = time.time()
          logger.debug(
              'cross validation for %d voxels, takes %.2f s' %
              (task[1], (time2 - time1))
          )
          return results
docs: Run voxelwise cross validation based on correlation vectors.
  
          clf: classification function
              the classifier to be used in cross validation
          data: 3D numpy array
              If using sklearn.svm.SVC with precomputed kernel,
              it is in shape [num_processed_voxels, num_epochs, num_epochs];
              otherwise it is the input argument corr,
              in shape [num_processed_voxels, num_epochs, num_voxels]
          task: tuple (start_voxel_id, num_processed_voxels)
              depicting the voxels assigned to compute
  
          Returns
          -------
          results: list of tuple (voxel_id, accuracy)
              the accuracy numbers of all voxels, in accuracy descending order
              the length of array equals the number of assigned voxels