code: def _generate_data(
      input_shape, mode="random", scale=2.0 / 255, bias=-1, img_size=256
  ):
      """
      Generate some random data according to a shape.
      """
      if input_shape is None or len(input_shape) == 0:
          return 0.5
      if mode == "zeros":
          X = np.zeros(input_shape)
      elif mode == "ones":
          X = np.ones(input_shape)
      elif mode == "linear":
          X = (
              np.array(range(np.product(input_shape))).reshape(
                  input_shape
              )
              * 1.0
          )
      elif mode == "random":
          X = np.random.rand(*input_shape)
      elif mode == "random_zero_mean":
          X = np.random.rand(*input_shape) - 0.5
      elif mode == "image":
          # Load a real image and do default tf imageNet preprocessing
          img_np, _ = _load_image(
              TEST_IMAGE, resize_to=(img_size, img_size)
          )
          img_tf = np.expand_dims(img_np, axis=0)
          X = img_tf * scale + bias
      elif mode == "onehot_0":
          X = np.zeros(input_shape)
          X[0] = 1
      return X
  
imports: import unittest
  import urllib
  import os
  import tarfile
  import zipfile
  import numpy
  import PIL.Image
  import tensorflow
  from tensorflow.core.framework import graph_pb2
  import tfcoreml
label_desc: Use image node_id 5 for calling a global function with example usage: _generate_data(input_shape, mode, scale, bias, img_size) and returns: X, int