code: def test_pixel_data(self):
      fifties = bytearray([50] * 100)
      img = image.Image(
          _image_data=fifties,
          _channels=1,
          _height=1,
          _width=100,
          _image_data_size=100,
          _format_enum=2,
      )
      pixel_data = img.pixel_data.flatten()
      self.assertEqual(pixel_data.shape, (100,))
  
      self.assertEqual(len(pixel_data), len(fifties))
      for p in range(len(pixel_data)):
          self.assertEqual(pixel_data[p], 50)
  
      # Load images and make sure shape is right
      img_color = image.Image(
          os.path.join(current_file_dir, "images", "sample.png")
      )
      self.assertEqual(img_color.pixel_data.shape, (444, 800, 3))
  
      img_gray = image.Image(
          os.path.join(
              current_file_dir, "images", "nested", "sample_grey.png"
          )
      )
      self.assertEqual(img_gray.pixel_data.shape, (444, 800))
  
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 12 for calling the ImageClassTest obj's underlying member method code with example usage: obj.test_pixel_data() without return types