code: def _get_data(image_length):
      from PIL import Image as _PIL_Image
  
      random = np.random.RandomState(100)
      _format = {"JPG": 0, "PNG": 1, "RAW": 2, "UNDEFINED": 3}
  
      def from_pil_image(pil_img):
          height = pil_img.size[1]
          width = pil_img.size[0]
          if pil_img.mode == "L":
              image_data = bytearray([z for z in pil_img.getdata()])
              channels = 1
          elif pil_img.mode == "RGB":
              image_data = bytearray(
                  [z for l in pil_img.getdata() for z in l]
              )
              channels = 3
          else:
              image_data = bytearray(
                  [z for l in pil_img.getdata() for z in l]
              )
              channels = 4
          format_enum = _format["RAW"]
          image_data_size = len(image_data)
          img = tc.Image(
              _image_data=image_data,
              _width=width,
              _height=height,
              _channels=channels,
              _format_enum=format_enum,
              _image_data_size=image_data_size,
          )
          return img
  
      num_examples = 100
      dims = (image_length, image_length)
      total_dims = dims[0] * dims[1]
      images = []
      for i in range(num_examples):
  
          def rand_image():
              return [random.randint(0, 255)] * total_dims
  
          pil_img = _PIL_Image.new("RGB", dims)
          pil_img.putdata(
              list(zip(rand_image(), rand_image(), rand_image()))
          )
          images.append(from_pil_image(pil_img))
  
      data = tc.SFrame({"awesome_image": tc.SArray(images)})
      return data
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import pytest
  import turicreate
  from turicreate.toolkits._internal_utils import _mac_ver
  import tempfile
  import shutil
  import coremltools
  import numpy
  from turicreate.toolkits._main import ToolkitError
label_desc: Use image node_id 1 for calling a global function with example usage: _get_data(image_length) and returns: data, img, unknown