code: def test_trivial_cases():
      # When all voxels are labeled
      img = np.ones((10, 10, 10))
      labels = np.ones((10, 10, 10))
  
      # It returns same labels which are provided
      pass_through = random_walker(img, labels)
      np.testing.assert_array_equal(pass_through, labels)
  
      # When there is no seed
      # Case 1: only masked pixels
      labels = -np.ones((10, 10, 10))
      # It returns the labels
      np.testing.assert_array_equal(random_walker(img, labels), labels)
  
      # Case 2: only unlabeled pixels
      labels = np.zeros((10, 10, 10))
      # It return the labels
      np.testing.assert_array_equal(random_walker(img, labels), labels)
  
file_path: nilearn/nilearn/_utils/tests/test_segmentation.py
imports: import numpy
  import pytest
  from nilearn._utils.segmentation import random_walker
label_desc: Use image node_id 4 for calling a global function with example usage: test_trivial_cases() without return types