code: def test_nearest_mode(self):
      for mode in [
          "1",
          "P",
          "L",
          "I",
          "F",
          "RGB",
          "RGBA",
          "CMYK",
          "YCbCr",
          "I;16",
      ]:  # exotic mode
          im = hopper(mode)
          r = self.resize(im, (15, 12), Image.NEAREST)
          assert r.mode == mode
          assert r.size == (15, 12)
          assert r.im.bands == im.im.bands
  
imports: from itertools import permutations
  import pytest
  from PIL import Image
  from .helper import assert_image_equal, assert_image_equal_tofile, assert_image_similar, hopper
label_desc: Use image node_id 2 for calling the TestImagingCoreResize obj's underlying member method code with example usage: obj.test_nearest_mode() without return types