code: def test_check_atlas():
      assert check_atlas(None) is None
      with pytest.raises(
          ValueError,
          match=(
              "Atlas is stored using type <class 'list'> "
              "which is neither np.ndarray or str"
          ),
      ):
          check_atlas([])
  
      A = np.random.rand(10, 100)
      assert check_atlas(A) == (10, 100)
  
      with tempfile.TemporaryDirectory() as datadir:
          f = os.path.join(datadir, "atlas")
          np.save(f, A)
          assert check_atlas(f + ".npy") == (10, 100)
  
      A = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5])
      assert check_atlas(A) == (5, 11)
  
      with tempfile.TemporaryDirectory() as datadir:
          f = os.path.join(datadir, "atlas")
          np.save(f, A)
          assert check_atlas(f + ".npy") == (5, 11)
  
      with pytest.raises(
          ValueError,
          match=(
              "Atlas has 3 axes. It should have either " "1 or 2 axes."
          ),
      ):
          check_atlas(np.random.rand(5, 1, 2))
  
      with pytest.raises(
          ValueError,
          match=(
              r"Number of regions in the atlas is lower than "
              r"the number of components \(3 < 5\)"
          ),
      ):
          check_atlas(np.random.rand(3, 10), n_components=5)
  
      with pytest.raises(
          ValueError,
          match=(
              r"Number of regions in the atlas is bigger than "
              r"the number of voxels \(5 > 2\)"
          ),
      ):
          check_atlas(np.random.rand(5, 2))
  
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 5 for calling a global function with example usage: test_check_atlas() without return types