code: def test_smatrix_3d():
      """Test the 3-d topological domain"""
      idx = generate_dataset(shape[:3])
      sm = smatrix_from_nd_idx(idx)
      ne = 2 * (
          3 * np.prod(shape[:3])
          - shape[0] * shape[1]
          - shape[0] * shape[2]
          - shape[1] * shape[2]
      )
      assert sm.data.size == ne
  
imports: import nibabel.gifti
  import numpy
  from nibabel import Nifti1Image
  from numpy.testing import assert_almost_equal, assert_array_equal
  from ..discrete_domain import domain_from_binary_array, domain_from_image, domain_from_mesh, grid_domain_from_binary_array, grid_domain_from_image, grid_domain_from_shape, smatrix_from_3d_array, smatrix_from_nd_array, smatrix_from_nd_idx
label_desc: Use image node_id 4 for calling a global function with example usage: test_smatrix_3d() without return types