code: def test_class_srm_inverse_transform(
      input_format,
      low_ram,
      tempdir,
      atlas,
      n_jobs,
      n_timeframes,
      aggregate,
  ):
      with tempfile.TemporaryDirectory() as datadir:
          X, W, S = generate_data(
              n_voxels,
              n_timeframes,
              n_subjects,
              n_components,
              datadir,
              0,
              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)
          shared_response_raw = srm.transform(X)
          # Check inverse transform
          if input_format == "list_of_array":
              reconstructed_data = srm.inverse_transform(
                  shared_response_raw, subjects_indexes=[0, 2]
              )
              for i, ii in enumerate([0, 2]):
                  assert_array_almost_equal(
                      reconstructed_data[i], X[ii], 3
                  )
  
              reconstructed_data = srm.inverse_transform(
                  shared_response_raw, subjects_indexes=None
              )
              for i in range(len(X)):
                  assert_array_almost_equal(
                      reconstructed_data[i], X[i], 3
                  )
          else:
              reconstructed_data = srm.inverse_transform(
                  shared_response_raw,
                  sessions_indexes=[1],
                  subjects_indexes=[0, 2],
              )
              for i, ii in enumerate([0, 2]):
                  for j, jj in enumerate([1]):
                      assert_array_almost_equal(
                          reconstructed_data[i][j],
                          safe_load(X[ii][jj]),
                          3,
                      )
  
              reconstructed_data = srm.inverse_transform(
                  shared_response_raw,
                  subjects_indexes=None,
                  sessions_indexes=None,
              )
  
              for i in range(len(X)):
                  for j in range(len(X[i])):
                      assert_array_almost_equal(
                          reconstructed_data[i][j],
                          safe_load(X[i][j]),
                          3,
                      )
  
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 16 for calling a global function with example usage: test_class_srm_inverse_transform(input_format, low_ram, tempdir, atlas, n_jobs, n_timeframes, aggregate) without return types