code: def test_fastsrm_class_correctness(
      input_format,
      low_ram,
      tempdir,
      atlas,
      n_jobs,
      n_timeframes,
      aggregate,
  ):
      with tempfile.TemporaryDirectory() as datadir:
          np.random.seed(0)
          X, W, S = generate_data(
              n_voxels,
              n_timeframes,
              n_subjects,
              n_components,
              datadir,
              0,
              input_format,
          )
  
          XX, n_sessions = apply_input_format(X, input_format)
  
          if tempdir:
              temp_dir = datadir
          else:
              temp_dir = None
  
          srm = FastSRM(
              atlas=atlas,
              n_components=n_components,
              n_iter=10,
              temp_dir=temp_dir,
              low_ram=low_ram,
              verbose=True,
              n_jobs=n_jobs,
              aggregate=aggregate,
              seed=0,
          )
  
          # Check that there is no difference between fit_transform
          # and fit then transform
  
          srm.fit(X)
          basis = [safe_load(b) for b in srm.basis_list]
          shared_response_raw = srm.transform(X)
          shared_response = apply_aggregate(
              shared_response_raw, aggregate, input_format
          )
          shared_response_fittransform = apply_aggregate(
              srm.fit_transform(X), aggregate, input_format
          )
  
          for j in range(n_sessions):
              assert_array_almost_equal(
                  shared_response_fittransform[j], shared_response[j]
              )
  
          # Check that the decomposition works
          for i in range(n_subjects):
              for j in range(n_sessions):
                  assert_array_almost_equal(
                      shared_response[j].T.dot(basis[i]), XX[i][j].T, 3
                  )
  
          # Check that if we use all subjects but one if gives almost the
          # same shared response
          shared_response_partial_raw = srm.transform(
              X[1:5], subjects_indexes=list(range(1, 5))
          )
  
          shared_response_partial = apply_aggregate(
              shared_response_partial_raw, aggregate, input_format
          )
          for j in range(n_sessions):
              assert_array_almost_equal(
                  shared_response_partial[j], shared_response[j], 3
              )
  
          # Check that if we perform add 2 times the same subject we
          # obtain the same decomposition
          srm.add_subjects(X[:1], shared_response_raw)
          assert_array_almost_equal(
              safe_load(srm.basis_list[0]),
              safe_load(srm.basis_list[-1]),
          )
  
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 15 for calling a global function with example usage: test_fastsrm_class_correctness(input_format, low_ram, tempdir, atlas, n_jobs, n_timeframes, aggregate) without return types