code: def sfn(l, msk, myrad, bcast_var):
      # Arguments:
      # l -- a list of 4D arrays, containing data from a single searchlight
      # msk -- a 3D binary array, mask of this searchlight
      # myrad -- an integer, sl_rad
      # bcast_var -- whatever is broadcasted
  
      # extract training and testing data
      train_data = []
      test_data = []
      d1, d2, d3, ntr = l[0].shape
      nvx = d1 * d2 * d3
      for s in l:
          train_data.append(
              np.reshape(
                  s[:, :, :, : int(ntr / 2)], (nvx, int(ntr / 2))
              )
          )
          test_data.append(
              np.reshape(
                  s[:, :, :, int(ntr / 2) :], (nvx, ntr - int(ntr / 2))
              )
          )
      # train an srm model
      srm = SRM(bcast_var[0], bcast_var[1])
      srm.fit(train_data)
      # transform test data
      shared_data = srm.transform(test_data)
      for s in range(len(l)):
          shared_data[s] = np.nan_to_num(
              stats.zscore(shared_data[s], axis=1, ddof=1)
          )
      # run experiment
      accu = time_segment_matching_accuracy(shared_data)
  
      # return: can also return several values. In that case, the final output will be
      # a 3D array of tuples
      return np.mean(accu)
  
file_path: brainiak/examples/funcalign/searchlight_srm_example.py
imports: import numpy
  from mpi4py import MPI
  import sys
  import scipy.io
  from scipy.stats import stats
  from brainiak.searchlight.searchlight import Searchlight
  from brainiak.funcalign.srm import SRM
  from brainiak.fcma.util import compute_correlation
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: sfn(l, msk, myrad, bcast_var) and returns: np