code: def load_image(image_file, image_size=None):
      """Loads an image and center-crops it to a specific size.
  
      Args:
        image_file: str. Image file.
        image_size: int, optional. Desired size. If provided, crops the image to
            a square and resizes it to the requested size. Defaults to None.
  
      Returns:
        A 4-D tensor of shape [1, image_size, image_size, 3] and dtype float32,
        with values in [0, 1].
      """
      image = tf.constant(np.uint8(load_np_image(image_file) * 255.0))
      if image_size is not None:
          # Center-crop into a square and resize to image_size
          small_side = int(min(image.shape[0], image.shape[1]))
          image = tf.image.resize_image_with_crop_or_pad(
              image, small_side, small_side
          )
          image = tf.image.resize_images(
              image, [image_size, image_size]
          )
      image = tf.to_float(image) / 255.0
  
      return tf.expand_dims(image, 0)
  
imports: import io
  import os
  import tempfile
  from magenta.models.image_stylization import imagenet_data
  import numpy
  import skimage.io
  import tensorflow.compat.v1
label_desc: Use image node_id 7 for calling a global function with example usage: load_image(image_file, image_size) and returns: tf