code: def load_image(image_path, transform=None, max_size=None, shape=None):
      """Load an image and convert it to a torch tensor."""
      image = Image.open(image_path)
  
      if max_size:
          scale = max_size / max(image.size)
          size = np.array(image.size) * scale
          image = image.resize(size.astype(int), Image.ANTIALIAS)
  
      if shape:
          image = image.resize(shape, Image.LANCZOS)
  
      if transform:
          image = transform(image).unsqueeze(0)
  
      return image.to(device)
  
file_path: pytorch-tutorial/tutorials/03-advanced/neural_style_transfer/main.py
imports: from __future__ import division
  from torchvision import models
  from torchvision import transforms
  from PIL import Image
  import argparse
  import torch
  import torchvision
  import torch.nn
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: load_image(image_path, transform, max_size, shape) and returns: image