code: def draw_samples(nsubj, ngroups, split_method="default"):
      """Draw randomly ngroups sets of samples from [0..nsubj-1]
  
      Parameters
      ----------
      nsubj, int, the total number of items
      ngroups, int, the number of desired groups
      split_method: string, optional,
                    to be chosen among 'default', 'bootstrap', 'jacknife'
                    if 'bootstrap', then each group will be nsubj
                       drawn with repetitions among nsubj
                    if 'jacknife' the population is divided into
                        ngroups disjoint equally-sized subgroups
                    if 'default', 'bootstrap' is used when nsubj < 10 * ngroups
                       otherwise jacknife is used
  
      Returns
      -------
      samples, a list of ngroups array that represent the subsets.
  
      fixme : this should allow variable bootstrap,
      i.e. draw ngroups of groupsize among nsubj
      """
      if split_method == "default":
          if nsubj > 10 * ngroups:
              samples = split_group(nsubj, ngroups)
          else:
              samples = bootstrap_group(nsubj, ngroups)
      elif split_method == "bootstrap":
          samples = bootstrap_group(nsubj, ngroups)
      elif split_method == "":
          samples = split_group(nsubj, ngroups)
      else:
          raise ValueError("unknown splitting method")
  
      return samples
  
imports: import numpy
  from nipy.io.nibcompat import get_affine
  from nipy.labs.spatial_models.discrete_domain import grid_domain_from_binary_array
label_desc: Use image node_id 14 for calling a global function with example usage: draw_samples(nsubj, ngroups, split_method) and returns: samples