code: def scale_img(img, min_size, max_size):
      """Process image."""
      _, H, W = img.shape
      scale = min_size / min(H, W)
      if scale * max(H, W) > max_size:
          scale = max_size / max(H, W)
      H, W = int(H * scale), int(W * scale)
      img = transforms.resize(img, (H, W))
      return img, scale
  
file_path: chainercv/chainercv/links/model/fpn/misc.py
imports: from __future__ import division
  import numpy
  from chainer.backends import cuda
  import chainer.functions
  from chainercv import transforms
label_desc: Use image node_id 4 for calling a global function with example usage: scale_img(img, min_size, max_size) and returns: img,  scale