code: def test_rankfilter():
      def rankfilter(mode):
          im = Image.new(mode, (3, 3), None)
          im.putdata(list(range(9)))
          # image is:
          #   0 1 2
          #   3 4 5
          #   6 7 8
          minimum = im.filter(ImageFilter.MinFilter).getpixel((1, 1))
          med = im.filter(ImageFilter.MedianFilter).getpixel((1, 1))
          maximum = im.filter(ImageFilter.MaxFilter).getpixel((1, 1))
          return minimum, med, maximum
  
      assert rankfilter("1") == (0, 4, 8)
      assert rankfilter("L") == (0, 4, 8)
      with pytest.raises(ValueError):
          rankfilter("P")
      assert rankfilter("RGB") == ((0, 0, 0), (4, 0, 0), (8, 0, 0))
      assert rankfilter("I") == (0, 4, 8)
      assert rankfilter("F") == (0.0, 4.0, 8.0)
  
file_path: pillow-simd/Tests/test_image_filter.py
imports: import pytest
  from PIL import Image, ImageFilter
  from .helper import assert_image_equal, hopper
label_desc: Use image node_id 4 for calling a global function with example usage: test_rankfilter() and returns: minimum,  med,  maximum