code: def test_sanity(filter_to_apply, mode):
      im = hopper(mode)
      if mode != "I" or isinstance(
          filter_to_apply, ImageFilter.BuiltinFilter
      ):
          out = im.filter(filter_to_apply)
          assert out.mode == im.mode
          assert out.size == im.size
  
file_path: pillow/Tests/test_image_filter.py
imports: from __future__ import annotations
  import pytest
  from PIL import Image, ImageFilter
  from .helper import assert_image_equal, hopper
label_desc: Use image node_id 1 for calling a global function with example usage: test_sanity(filter_to_apply, mode) without return types