code: def test_change_clim_float(dtype, init_clim):
      """Test that with an image of floats, clim is correctly set from the first try.
  
      See https://github.com/vispy/vispy/pull/2245.
      """
      size = (40, 40)
      np.random.seed(0)
      data = (np.random.rand(*size) * 100).astype(dtype)
  
      with TestingCanvas(size=size[::-1], bgcolor="w") as c:
          image = Image(data=data, clim=init_clim, parent=c.scene)
  
          # needed to properly initialize the canvas
          c.render()
  
          image.clim = 0, 10
          rendered1 = c.render()
          # set clim to same values
          image.clim = 0, 10
          rendered2 = c.render()
  
          assert np.allclose(rendered1, rendered2)
  
file_path: vispy/vispy/visuals/tests/test_image.py
imports: from unittest import mock
  from vispy.scene import Image, PanZoomCamera
  from vispy.testing import requires_application, TestingCanvas, run_tests_if_main, IS_CI
  from vispy.testing.image_tester import assert_image_approved, downsample
  import numpy
  import pytest
  from vispy.testing.rendered_array_tester import compare_render, max_for_dtype
label_desc: Use image node_id 11 for calling a global function with example usage: test_change_clim_float(dtype, init_clim) without return types