class_docstr: Distributed Searchlight
  
  Run a user-defined function over each voxel in a multi-subject
  dataset.
  
  Optionally, users can define a block function which runs over
  larger portions of the volume called blocks.
  
  Parameters
  ----------
  
  sl_rad: radius, in voxels, of the sphere inscribed in the
             searchlight cube, not counting the center voxel
  
  max_blk_edge: max edge length, in voxels, of the 3D block
  
  shape: brainiak.searchlight.searchlight.Shape indicating the
  shape in voxels of the searchlight region
  
  min_active_voxels_proportion: float
      If a searchlight region does not have more than this minimum
      proportion of active voxels in the mask, it is not processed by the
      searchlight function. The mask used for the test is the
      intersection of the global (brain) mask and the `Shape` mask. The
      seed (central) voxel of the searchlight region is taken into
      consideration.
class_docstr_tok: ["Distributed","Searchlight","Run","a","user-defined","function","over","each","voxel","in","a","multi-subject","dataset",".","Optionally",",","users","can","define","a","block","function","which","runs","over","larger","portions","of","the","volume","called","blocks",".","Parameters","--","--","--","--","--","sl_rad",":","radius",",","in","voxels",",","of","the","sphere","inscribed","in","the","searchlight","cube",",","not","counting","the","center","voxel","max_blk_edge",":","max","edge","length",",","in","voxels",",","of","the","3D","block","shape",":","brainiak.searchlight.searchlight.Shape","indicating","the","shape","in","voxels","of","the","searchlight","region","min_active_voxels_proportion",":","float","If","a","searchlight","region","does","not","have","more","than","this","minimum","proportion","of","active","voxels","in","the","mask",",","it","is","not","processed","by","the","searchlight","function",".","The","mask","used","for","the","test","is","the","intersection","of","the","global","(","brain",")","mask","and","the","`","Shape","`","mask",".","The","seed","(","central",")","voxel","of","the","searchlight","region","is","taken","into","consideration","."]
docstr: Perform a function at each voxel which is set to True in the
  user-provided mask. The mask passed to the searchlight function will be
  further masked by the user-provided searchlight shape.
  
  Parameters
  ----------
  
  voxel_fn: function to apply at each voxel
  
      Must be `serializeable using pickle
      <https://docs.python.org/3/library/pickle.html#what-can-be-pickled-and-unpickled>`_.
  
          Parameters
  
          subj: list of 4D arrays containing subset of subject data
  
          mask: 3D array containing subset of mask data
  
          sl_rad: radius, in voxels, of the sphere inscribed in the
          cube
  
          bcast_var: shared data which is broadcast to all processes
  
  
          Returns
  
          Value of any pickle-able type
  
  Returns
  -------
  
  A volume which is the same size as the mask, however a number of voxels
  equal to the searchlight radius has been removed from each border of
  the volume. This volume contains the values returned from the
  searchlight function at each voxel which was set to True in the mask,
  and None elsewhere.
docstr_tok: ["Perform","a","function","at","each","voxel","which","is","set","to","True","in","the","user-provided","mask",".","The","mask","passed","to","the","searchlight","function","will","be","further","masked","by","the","user-provided","searchlight","shape",".","Parameters","--","--","--","--","--","voxel_fn",":","function","to","apply","at","each","voxel","Must","be","`","serializeable","using","pickle","<","https",":","\/\/docs.python.org\/3\/library\/pickle.html","#","what-can-be-pickled-and-unpickled",">","`","_",".","Parameters","subj",":","list","of","4D","arrays","containing","subset","of","subject","data","mask",":","3D","array","containing","subset","of","mask","data","sl_rad",":","radius",",","in","voxels",",","of","the","sphere","inscribed","in","the","cube","bcast_var",":","shared","data","which","is","broadcast","to","all","processes","Returns","Value","of","any","pickle-able","type","Returns","--","--","--","-","A","volume","which","is","the","same","size","as","the","mask",",","however","a","number","of","voxels","equal","to","the","searchlight","radius","has","been","removed","from","each","border","of","the","volume",".","This","volume","contains","the","values","returned","from","the","searchlight","function","at","each","voxel","which","was","set","to","True","in","the","mask",",","and","None","elsewhere","."]
code: def run_searchlight(self, voxel_fn, pool_size=None):
      """Perform a function at each voxel which is set to True in the
      user-provided mask. The mask passed to the searchlight function will be
      further masked by the user-provided searchlight shape.
  
      Parameters
      ----------
  
      voxel_fn: function to apply at each voxel
  
          Must be `serializeable using pickle
          <https://docs.python.org/3/library/pickle.html#what-can-be-pickled-and-unpickled>`_.
  
              Parameters
  
              subj: list of 4D arrays containing subset of subject data
  
              mask: 3D array containing subset of mask data
  
              sl_rad: radius, in voxels, of the sphere inscribed in the
              cube
  
              bcast_var: shared data which is broadcast to all processes
  
  
              Returns
  
              Value of any pickle-able type
  
      Returns
      -------
  
      A volume which is the same size as the mask, however a number of voxels
      equal to the searchlight radius has been removed from each border of
      the volume. This volume contains the values returned from the
      searchlight function at each voxel which was set to True in the mask,
      and None elsewhere.
  
      """
  
      extra_block_fn_params = (
          voxel_fn,
          self.shape,
          self.min_active_voxels_proportion,
      )
      block_fn_result = self.run_block_function(
          _singlenode_searchlight, extra_block_fn_params, pool_size
      )
      return block_fn_result
  
imports: from multiprocessing import Pool
  import numpy
  from mpi4py import MPI
  from scipy.spatial.distance import cityblock, euclidean
  from ..utils.utils import usable_cpu_count
label_desc: Use image node_id 10 for calling the Searchlight obj's underlying member method code with example usage: obj.run_searchlight(voxel_fn, pool_size) and returns: block_fn_result