code: def divide_1Darray_equally(ind, nsub):
      
  
      n_ind = len(ind)
      sub2ind = partition_equally_1d(ind, nsub, order='interlaced')
  
      ind2sub = []
      for i in range(n_ind):
          ind2sub.append([])
  
      for i in range(nsub):
          for j in sub2ind[i]:
              ind2sub[j].append(i)
  
      return (sub2ind, ind2sub)
docs: Divide an array into equal chunks to be used for instance in OSEM.
  
      Parameters
      ----------
      ind : ndarray
          input array
      nsubsets : int
          number of subsets to be divided into
  
      Returns
      -------
      sub2ind : list
          list of indices for each subset
      ind2sub : list
          list of subsets for each index