code: def test_check_imgs():
      with pytest.raises(
          ValueError,
          match=(
              r"Since imgs is a list, it should be a list of list "
              r"of arrays or a list "
              r"of arrays but imgs\[0\] has type <class 'str'>"
          ),
      ):
          check_imgs(["bla"])
  
      with pytest.raises(
          ValueError,
          match=(
              "Input imgs should either be a list or an array but "
              "has type <class 'str'>"
          ),
      ):
          check_imgs("bla")
  
      with pytest.raises(ValueError, match=empty_list_error % "imgs"):
          check_imgs([])
  
      with pytest.raises(
          ValueError,
          match=r"imgs\[1\] has type <class 'str'> whereas imgs\[0\] has "
          "type <class 'int'>. This is inconsistent.",
      ):
          check_imgs([0, "bla"])
  
      with pytest.raises(
          ValueError, match=empty_list_error % r"imgs\[0\]"
      ):
          check_imgs([[]])
  
      with pytest.raises(
          ValueError,
          match=(
              r"imgs\[1\] has length 1 whereas imgs\[0\] has length 2."
              " All subjects should have the same number of sessions."
          ),
      ):
          check_imgs([["a", "a"], ["a"]])
  
      with pytest.raises(
          ValueError,
          match=array_type_error
          % (r"imgs\[0\]\[0\]", r"<class 'str'>"),
      ):
          check_imgs([["bka"]])
  
      with pytest.raises(
          ValueError, match=array_2axis_error % (r"imgs\[0\]\[0\]", 1)
      ):
          check_imgs([[np.random.rand(5)]])
  
      with pytest.raises(
          ValueError, match=array_2axis_error % (r"imgs\[0\]", 1)
      ):
          check_imgs([np.random.rand(5)])
  
      with pytest.raises(
          ValueError,
          match=(
              r"imgs\[0, 0\] is stored using type "
              "<class 'numpy.float64'> which is not a str"
          ),
      ):
          check_imgs(np.random.rand(5, 3))
  
      with pytest.raises(
          ValueError, match=array_2axis_error % (r"imgs", 1)
      ):
          check_imgs(np.random.rand(5))
  
      with pytest.raises(
          ValueError,
          match=("The number of subjects should be greater than 1"),
      ):
          check_imgs([np.random.rand(5, 3)])
  
      with pytest.raises(
          ValueError,
          match=(
              "Subject 1 Session 0 does not have the same number "
              "of timeframes as Subject 0 Session 0"
          ),
      ):
          check_imgs([np.random.rand(10, 5), np.random.rand(10, 10)])
  
      with pytest.raises(
          ValueError,
          match=(
              "Subject 1 Session 0 does not have the same number "
              "of voxels as Subject 0 Session 0"
          ),
      ):
          check_imgs([np.random.rand(10, 5), np.random.rand(20, 5)])
  
      with pytest.raises(
          ValueError,
          match=(
              "Total number of timeframes is shorter than number "
              r"of components \(5 < 8\)"
          ),
      ):
          check_imgs(
              [np.random.rand(10, 5), np.random.rand(10, 5)],
              n_components=8,
          )
  
      with pytest.raises(
          ValueError,
          match=(
              "Number of voxels in the atlas is not the same as "
              r"the number of voxels in input data \(11 != 10\)"
          ),
      ):
          check_imgs(
              [np.random.rand(10, 5), np.random.rand(10, 5)],
              n_components=3,
              atlas_shape=(8, 11),
          )
  
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 6 for calling a global function with example usage: test_check_imgs() without return types