code: def test_singleton_dim():
      """Ensure images where size of a given dimension is 1 work correctly."""
      image = np.random.rand(1, 1000)
      noisy = random_noise(image, mode="salt", amount=0.1, rng=42)
      tolerance = 5e-2
      assert abs(np.average(noisy == 1) - 0.1) <= tolerance
  
file_path: scikit-image/skimage/util/tests/test_random_noise.py
imports: from skimage._shared import testing
  from skimage._shared.testing import assert_array_equal, assert_allclose
  import numpy
  from skimage.data import camera
  from skimage.util import random_noise, img_as_float
label_desc: Use image node_id 4 for calling a global function with example usage: test_singleton_dim() without return types