code: def masks(list_of_index_lists, n):
      
      # make a list of mask arrays, it's easier to store
      # as there is a hdf5 equivalent
      for il,l in enumerate(list_of_index_lists):
          mask = np.zeros(n,dtype=bool)
          mask[l] = True
          list_of_index_lists[il] = mask
      # convert to arrays
      masks = np.array(list_of_index_lists)
      return masks
docs: Make an array in which rows store 1d mask arrays from list of index lists.
  
      Parameters
      ----------
      n : int
          Maximal index / number of samples.