code: def test_volume_grid():
      """Sanity testing of the VolumeGrid class."""
      transform = Transform("voxels", "world", mapping)
      img = VolumeGrid(
          data=np.random.random((10, 10, 10)),
          transform=transform,
      )
      # Test that the repr doesn't raise an error
      repr(img)
  
      # We cannot calculate the values in the world, because the transform
      # is not invertible.
  
      pytest.raises(ValueError, img.values_in_world, 0, 0, 0)
      pytest.raises(ValueError, img.as_volume_img)
      assert img == copy.copy(img)
  
file_path: nipy/nipy/labs/datasets/volumes/tests/test_volume_grid.py
imports: import copy
  import numpy
  import pytest
  from ...transforms.transform import CompositionError, Transform
  from ..volume_grid import VolumeGrid
  from ..volume_img import VolumeImg
label_desc: Use image node_id 5 for calling a global function with example usage: test_volume_grid() without return types