code: def test_unsupervised_wiener(dtype):
      psf = np.ones((5, 5), dtype=dtype) / 25
      data = convolve2d(test_img, psf, "same")
      seed = 16829302
      # keep old-style RandomState here for compatibility with previously stored
      # reference data in camera_unsup.npy and camera_unsup2.npy
      rng = np.random.RandomState(seed)
      data += 0.1 * data.std() * rng.standard_normal(data.shape)
      data = data.astype(dtype, copy=False)
      deconvolved, _ = restoration.unsupervised_wiener(
          data, psf, rng=seed
      )
      restoration.unsupervised_wiener(data, psf, rng=seed)
      float_type = _supported_float_type(dtype)
      assert deconvolved.dtype == float_type
  
      rtol, atol = _get_rtol_atol(dtype)
      path = fetch("restoration/tests/camera_unsup.npy")
      np.testing.assert_allclose(
          deconvolved, np.load(path), rtol=rtol, atol=atol
      )
  
      _, laplacian = uft.laplacian(2, data.shape)
      otf = uft.ir2tf(psf, data.shape, is_real=False)
      assert otf.real.dtype == _supported_float_type(dtype)
      deconvolved2 = restoration.unsupervised_wiener(
          data,
          otf,
          reg=laplacian,
          is_real=False,
          user_params={
              "callback": lambda x: None,
              "max_num_iter": 200,
              "min_num_iter": 30,
          },
          rng=seed,
      )[0]
      assert deconvolved2.real.dtype == float_type
      path = fetch("restoration/tests/camera_unsup2.npy")
      np.testing.assert_allclose(
          np.real(deconvolved2), np.load(path), rtol=rtol, atol=atol
      )
  
file_path: scikit-image/skimage/restoration/tests/test_restoration.py
imports: import numpy
  import pytest
  from scipy import ndimage
  from scipy.signal import convolve2d, convolve
  from skimage import restoration, util
  from skimage._shared import filters
  from skimage._shared.testing import fetch
  from skimage._shared.utils import _supported_float_type
  from skimage.color import rgb2gray
  from skimage.data import astronaut, camera
  from skimage.restoration import uft
label_desc: Use image node_id 3 for calling a global function with example usage: test_unsupervised_wiener(dtype) without return types