code: def prepare(image, size=(224, 224)):
      """Converts the given image to a numpy array for ResNet.
  
      Note that this method must be called before calling ``forward``,
      because the pre-trained resnet model will resize the given
      image, convert from RGB to BGR, subtract the mean,
      and permute the dimensions before calling.
  
      Args:
          image (PIL.Image or numpy.ndarray): Input image.
              If an input is ``numpy.ndarray``, its shape must be
              ``(height, width)``, ``(height, width, channels)``,
              or ``(channels, height, width)``, and
              the order of the channels must be RGB.
          size (pair of ints): Size of converted images.
              If ``None``, the given image is not resized.
  
      Returns:
          numpy.ndarray: The converted output array.
  
      """
  
      if not available:
          raise ImportError(
              "PIL cannot be loaded. Install Pillow!\n"
              "The actual import error is as follows:\n"
              + str(_import_error)
          )
      dtype = chainer.get_dtype()
      if isinstance(image, numpy.ndarray):
          if image.ndim == 3:
              if image.shape[0] == 1:
                  image = image[0, :, :]
              elif image.shape[0] == 3:
                  image = image.transpose((1, 2, 0))
          image = Image.fromarray(image.astype(numpy.uint8))
      image = image.convert("RGB")
      if size:
          image = image.resize(size)
      image = numpy.asarray(image, dtype=dtype)
      image = image[:, :, ::-1]
      # NOTE: in the original paper they subtract a fixed mean image,
      #       however, in order to support arbitrary size we instead use the
      #       mean pixel (rather than mean image) as with VGG team. The mean
      #       value used in ResNet is slightly different from that of VGG16.
      image -= numpy.array([103.063, 115.903, 123.152], dtype=dtype)
      image = image.transpose((2, 0, 1))
      return image
  
imports: import collections
  import os
  import sys
  import warnings
  import numpy
  import chainer
  from chainer.dataset.convert import concat_examples
  from chainer.dataset import download
  from chainer import function
  from chainer.functions.activation.relu import relu
  from chainer.functions.activation.softmax import softmax
  from chainer.functions.array.reshape import reshape
  from chainer.functions.math.sum import sum
  from chainer.functions.pooling.average_pooling_2d import average_pooling_2d
  from chainer.functions.pooling.max_pooling_nd import max_pooling_2d
  from chainer.initializers import constant
  from chainer.initializers import normal
  from chainer import link
  from chainer.links.connection.convolution_2d import Convolution2D
  from chainer.links.connection.linear import Linear
  from chainer.links.normalization.batch_normalization import BatchNormalization
  from chainer.serializers import npz
  from chainer.utils import argument
  from chainer.utils import imgproc
  from chainer.variable import Variable
label_desc: Use image node_id 1 for calling a global function with example usage: prepare(image, size) and returns: image