code: def test_resize(self):
      for meta_info in test_image_info:
          glimage = image.Image(
              path=meta_info.url, format=meta_info.format
          )
  
          # Test resize image to half the size and twice the size
          for scale in [0.5, 2]:
              # Test resize image with color type changes
              for new_channels in [None, 1, 3, 4]:
                  new_width = int(scale * glimage.width)
                  new_height = int(scale * glimage.height)
                  glimage_resized = image_analysis.resize(
                      glimage, new_width, new_height, new_channels
                  )
                  pilimage = PIL_Image.open(meta_info.url).resize(
                      (new_width, new_height), PIL_Image.NEAREST
                  )
                  if new_channels == 1:
                      pilimage = pilimage.convert("L")
                  elif new_channels == 3:
                      pilimage = pilimage.convert("RGB")
                  elif new_channels == 4:
                      pilimage = pilimage.convert("RGBA")
                  self.__check_raw_image_equals_pilimage(
                      glimage_resized, pilimage
                  )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import array
  import unittest
  from PIL import Image
  import os
  from ..data_structures import image
  from ..None import SArray
  from ..toolkits.image_analysis import image_analysis
  from ..toolkits._main import ToolkitError
  from .._deps import numpy, HAS_NUMPY
label_desc: Use image node_id 4 for calling the ImageClassTest obj's underlying member method code with example usage: obj.test_resize() without return types