code: def test_custom_opacity(lut, skip_check_gc):
      values_copy = lut.values.copy()
      lut.apply_opacity("sigmoid")
      assert not np.array_equiv(lut.values[:, -1], 255)
      # check RGB isn't changed when applying an opacity
      assert np.array_equal(values_copy[:, :-1], lut.values[:, :-1])
  
      # ensure opacity is not reset when changing the colormap
      opac_orig = lut.values[:, -1].copy()
      lut.cmap = "jet"
      assert np.array_equal(lut.values[:, -1], opac_orig)
  
      lut.apply_opacity(0)
      assert np.array_equiv(lut.values[:, -1], 0)
      lut.apply_opacity(0.5)
      assert np.array_equiv(lut.values[:, -1], int(255 * 0.5))
      lut.apply_opacity(1)
      assert np.array_equiv(lut.values[:, -1], 255)
  
      with pytest.raises(ValueError, match="between 0 and 1"):
          lut.apply_opacity(-0.1)
  
imports: import numpy
  import pytest
  import vtk
  import pyvista
  from pyvista import Color, LookupTable
label_desc: Use image node_id 25 for calling a global function with example usage: test_custom_opacity(lut, skip_check_gc) without return types