code: def test_endianness(self):
      # Make an image with one colored pixel, in one channel.
      # When resized, that channel should be the same as a GS image.
      # Other channels should be unaffected.
      # The R and A channels should not swap, which is indicative of
      # an endianness issues.
  
      samples = {
          "blank": Image.new("L", (2, 2), 0),
          "filled": Image.new("L", (2, 2), 255),
          "dirty": Image.new("L", (2, 2), 0),
      }
      samples["dirty"].putpixel((1, 1), 128)
  
      for f in [
          Image.NEAREST,
          Image.BOX,
          Image.BILINEAR,
          Image.HAMMING,
          Image.BICUBIC,
          Image.LANCZOS,
      ]:
          # samples resized with current filter
          references = {
              name: self.resize(ch, (4, 4), f)
              for name, ch in samples.items()
          }
  
          for mode, channels_set in [
              ("RGB", ("blank", "filled", "dirty")),
              ("RGBA", ("blank", "blank", "filled", "dirty")),
              ("LA", ("filled", "dirty")),
          ]:
              for channels in set(permutations(channels_set)):
                  # compile image from different channels permutations
                  im = Image.merge(
                      mode, [samples[ch] for ch in channels]
                  )
                  resized = self.resize(im, (4, 4), f)
  
                  for i, ch in enumerate(resized.split()):
                      # check what resized channel in image is the same
                      # as separately resized channel
                      assert_image_equal(ch, references[channels[i]])
  
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 6 for calling the TestImagingCoreResize obj's underlying member method code with example usage: obj.test_endianness() without return types