code: def test_set_data_does_not_change_input():
      # Create volume
      V = scene.visuals.Volume(np.zeros((20, 20, 20), dtype=np.float32))
  
      # calling Volume.set_data() should NOT alter the values of the input array
      # regardless of data type
      vol = np.random.randint(0, 200, (20, 20, 20))
      for dtype in ["uint8", "int16", "uint16", "float32", "float64"]:
          vol_copy = np.array(vol, dtype=dtype, copy=True)
          # setting clim so that normalization would otherwise change the data
          V.set_data(vol_copy, clim=(0, 200))
          assert np.allclose(vol, vol_copy)
  
      # dtype has to be the same as the one used to init the texture, or it will
      # be first coerced to the same dtype as the init
  
      vol2 = np.array(vol, dtype=np.float32, copy=True)
      assert np.allclose(vol, vol2)
      # we explicitly create a copy when data would be altered by the texture,
      # no matter what the user asks, so the data outside should never change
      V.set_data(vol2, clim=(0, 200), copy=False)
      assert np.allclose(vol, 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 8 for calling a global function with example usage: test_set_data_does_not_change_input() without return types