code: def _reduced_space_compute_shared_response(
      reduced_data_list, reduced_basis_list, n_components=50
  ):
      """Compute shared response with basis fixed in reduced space
  
      Parameters
      ----------
  
      reduced_data_list : array of str, shape=[n_subjects, n_sessions]
      or array, shape=[n_subjects, n_sessions, n_timeframes, n_supervoxels]
          Element i, j of the array is a path to the data of subject i
          collected during session j.
          Data are loaded with numpy.load and expected shape is
          [n_timeframes, n_supervoxels]
          or Element i, j of the array is the data in array of
          shape=[n_timeframes, n_supervoxels]
          n_timeframes and n_supervoxels are
          assumed to be the same across subjects
          n_timeframes can vary across sessions
          Each voxel's timecourse is assumed to have mean 0 and variance 1
  
      reduced_basis_list : None or list of array, element i has
      shape=[n_components, n_supervoxels]
          each subject's reduced basis
          if None the basis will be generated on the fly
  
      n_components : int or None
          number of components
  
      Returns
      -------
  
      shared_response_list : list of array, element i has
      shape=[n_timeframes, n_components]
          shared response, element i is the shared response during session i
  
      """
      n_subjects, n_sessions = reduced_data_list.shape[:2]
  
      s = [None] * n_sessions
  
      # This is just to check that all subjects have same number of
      # timeframes in a given session
      for n in range(n_subjects):
          for m in range(n_sessions):
              data_nm = safe_load(reduced_data_list[n][m])
              n_timeframes, n_supervoxels = data_nm.shape
  
              if reduced_basis_list is None:
                  reduced_basis_list = []
                  for subject in range(n_subjects):
                      q = np.eye(n_components, n_supervoxels)
                      reduced_basis_list.append(q)
  
              basis_n = reduced_basis_list[n]
              if s[m] is None:
                  s[m] = data_nm.dot(basis_n.T)
              else:
                  s[m] = s[m] + data_nm.dot(basis_n.T)
  
      for m in range(n_sessions):
          s[m] = s[m] / float(n_subjects)
  
      return s
  
imports: import hashlib
  import logging
  import os
  import numpy
  import scipy
  from joblib import Parallel, delayed
  from brainiak.funcalign.srm import DetSRM
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.exceptions import NotFittedError
  import uuid
label_desc: Use image node_id 25 for calling a global function with example usage: _reduced_space_compute_shared_response(reduced_data_list, reduced_basis_list, n_components) and returns: s