code: def test_denoise_tv_chambolle_3d():
      """Apply the TV denoising algorithm on a 3D image representing a sphere."""
      x, y, z = np.ogrid[0:40, 0:40, 0:40]
      mask = (x - 22) ** 2 + (y - 20) ** 2 + (z - 17) ** 2 < 8**2
      mask = 100 * mask.astype(float)
      mask += 60
      mask += 20 * np.random.rand(*mask.shape)
      mask[mask < 0] = 0
      mask[mask > 255] = 255
      res = restoration.denoise_tv_chambolle(
          mask.astype(np.uint8), weight=0.1
      )
      assert res.dtype == float
      assert res.std() * 255 < mask.std()
  
imports: import functools
  import itertools
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_warns
  from skimage import color, data, img_as_float, restoration
  from skimage._shared._warnings import expected_warnings
  from skimage._shared.utils import _supported_float_type, slice_at_axis
  from skimage.metrics import peak_signal_noise_ratio, structural_similarity
  from skimage.restoration._denoise import _wavelet_threshold
label_desc: Use image node_id 4 for calling a global function with example usage: test_denoise_tv_chambolle_3d() without return types