code: def test_set_data_changes_shape():
      dtype = np.float32
      # Create initial volume
      V = scene.visuals.Volume(np.zeros((20, 20, 20), dtype=dtype))
  
      # Sending new three dimensional data of different shape should alter volume shape
      vol = np.zeros((25, 25, 10), dtype=dtype)
      V.set_data(vol)
      assert V._vol_shape == (25, 25, 10)
  
      # Sending data of dimension other than 3 should raise a ValueError
      vol2 = np.zeros((20, 20), dtype=dtype)
      with pytest.raises(ValueError):
          V.set_data(vol2)
  
      vol2 = np.zeros((20, 20, 20, 20), dtype=dtype)
      with pytest.raises(ValueError):
          V.set_data(vol2)
  
imports: import pytest
  import numpy
  from vispy import scene
  from vispy.testing import TestingCanvas, requires_application, run_tests_if_main, requires_pyopengl, raises
  from vispy.testing.image_tester import assert_image_approved, downsample
  from vispy.testing.rendered_array_tester import compare_render, max_for_dtype
label_desc: Use image node_id 9 for calling a global function with example usage: test_set_data_changes_shape() without return types