code: def test_PSNR_float(dtype):
      p_uint8 = peak_signal_noise_ratio(cam, cam_noisy)
      camf = (cam / 255.0).astype(dtype, copy=False)
      camf_noisy = (cam_noisy / 255.0).astype(dtype, copy=False)
      p_float64 = peak_signal_noise_ratio(
          camf, camf_noisy, data_range=1
      )
      assert p_float64.dtype == np.float64
      decimal = 3 if dtype == np.float16 else 5
      assert_almost_equal(p_uint8, p_float64, decimal=decimal)
  
      # mixed precision inputs
      p_mixed = peak_signal_noise_ratio(
          cam / 255.0, np.float32(cam_noisy / 255.0), data_range=1
      )
  
      assert_almost_equal(p_mixed, p_float64, decimal=decimal)
  
      # mismatched dtype results in a warning if data_range is unspecified
      with expected_warnings(["Inputs have mismatched dtype"]):
          p_mixed = peak_signal_noise_ratio(
              cam / 255.0, np.float32(cam_noisy / 255.0)
          )
      assert_almost_equal(p_mixed, p_float64, decimal=decimal)
  
      # mismatched dtype results in a warning if data_range is unspecified
      with expected_warnings(["Inputs have mismatched dtype"]):
          p_mixed = peak_signal_noise_ratio(
              cam / 255.0, np.float32(cam_noisy / 255.0)
          )
      assert_almost_equal(p_mixed, p_float64, decimal=decimal)
  
file_path: scikit-image/skimage/metrics/tests/test_simple_metrics.py
imports: import numpy
  import pytest
  from numpy.testing import assert_equal, assert_almost_equal
  from skimage import data
  from skimage._shared._warnings import expected_warnings
  from skimage.metrics import peak_signal_noise_ratio, normalized_root_mse, mean_squared_error, normalized_mutual_information
label_desc: Use image node_id 2 for calling a global function with example usage: test_PSNR_float(dtype) without return types