code: def test_generated_data():
      with tempfile.TemporaryDirectory() as datadir:
          # We authorize different timeframes for different sessions
          # but they should be the same across subject
          n_voxels = 10
          n_timeframes = [25, 24]
          n_subjects = 2
          n_components = 3  # number of components used for SRM model
          n_sessions = len(n_timeframes)
  
          np.random.seed(0)
          paths, W, S = generate_data(
              n_voxels, n_timeframes, n_subjects, n_components, datadir
          )
  
          # Test if generated data has the good shape
          for subject in range(n_subjects):
              for session in range(n_sessions):
                  assert np.load(paths[subject, session]).shape == (
                      n_voxels,
                      n_timeframes[session],
                  )
  
          # Test if generated basis have good shape
          assert len(W) == n_subjects
          for w in W:
              assert w.shape == (n_components, n_voxels)
  
          assert len(S) == n_sessions
          for j, s in enumerate(S):
              assert s.shape == (n_components, n_timeframes[j])
  
imports: import os
  import tempfile
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from sklearn.exceptions import NotFittedError
  from brainiak.funcalign.fastsrm import FastSRM, _compute_and_save_corr_mat, _compute_and_save_subject_basis, _compute_basis_subject_online, _reduced_space_compute_shared_response, check_atlas, check_imgs, check_shared_response, create_temp_dir, fast_srm, reduce_data, safe_load
  from brainiak.funcalign.srm import DetSRM
label_desc: Use image node_id 3 for calling a global function with example usage: test_generated_data() without return types