code: def test_2d_eq_4d(data):
      arr4d = data["fmridata"]
      shp = arr4d.shape
      arr2d = arr4d.reshape((np.prod(shp[:3]), shp[3]))
      arr3d = arr4d.reshape((shp[0], -1, shp[3]))
      res4d = pos1pca(arr4d, axis=-1, standardize=False)
      res3d = pos1pca(arr3d, axis=-1, standardize=False)
      res2d = pos1pca(arr2d, axis=-1, standardize=False)
      assert_array_almost_equal(
          res4d["basis_vectors"], res2d["basis_vectors"]
      )
      assert_array_almost_equal(
          res4d["basis_vectors"], res3d["basis_vectors"]
      )
  
imports: import numpy
  import pytest
  from nipy.io.api import load_image
  from nipy.testing import assert_almost_equal, assert_array_almost_equal, funcfile
  from ..pca import pca
label_desc: Use image node_id 7 for calling a global function with example usage: test_2d_eq_4d(data) without return types