code: def _stack_list(data, data_labels, w):
          
          labels_stacked = utils.concatenate_not_none(data_labels)
  
          weights = np.empty((labels_stacked.size,))
          data_shared = [None] * len(data)
          curr_samples = 0
          for s in range(len(data)):
              if data[s] is not None:
                  subject_samples = data[s].shape[1]
                  curr_samples_end = curr_samples + subject_samples
                  weights[curr_samples:curr_samples_end] = subject_samples
                  data_shared[s] = w[s].T.dot(data[s])
                  curr_samples += data[s].shape[1]
  
          data_stacked = utils.concatenate_not_none(data_shared, axis=1).T
          return data_stacked, labels_stacked, weights
docs: Construct a numpy array by stacking arrays in a list
  
          Parameter
          ----------
  
          data : list of 2D arrays, element i has shape=[voxels_i, samples_i]
              Each element in the list contains the fMRI data of one subject for
              the classification task.
  
          data_labels : list of arrays of int, element i has shape=[samples_i]
              Each element in the list contains the labels for the samples in
              data.
  
          w : list of array, element i has shape=[voxels_i, features]
              The orthogonal transforms (mappings) :math:`W_i` for each subject.
  
  
          Returns
          -------
  
          data_stacked : 2D array, shape=[samples, features]
              The data samples from all subjects are stacked into a single
              2D array, where "samples" is the sum of samples_i.
  
          labels_stacked : array, shape=[samples,]
              The labels from all subjects are stacked into a single
              array, where "samples" is the sum of samples_i.
  
          weights : array, shape=[samples,]
              The number of samples of the subject that are related to that
              sample. They become a weight per sample in the MLR loss.