code: def run_permute_test(design, contrast, nsample=1000):
      rc = setup_client()
      dview = rc[:]
      nnod = len(dview)
      # Samples per node.  Round up
      ns_nod = np.ceil(nsample / float(nnod))
  
      def _run_test(n, des, con):
          import fiac_example
          from fiac_example import GROUP_MASK
  
          min_vals, max_vals = fiac_example.permutation_test(
              des, con, GROUP_MASK, n
          )
          return min_vals, max_vals
  
      ar = dview.apply_async(_run_test, ns_nod, design, contrast)
      min_vals, max_vals = zip(*list(ar))
      return np.concatenate(min_vals), np.concatenate(max_vals)
  
file_path: nipy/examples/fiac/parallel_run.py
imports: import os
  import numpy
  from IPython import parallel
label_desc: Use image node_id 7 for calling a global function with example usage: run_permute_test(design, contrast, nsample) and returns: np,  np, min_vals,  max_vals