code: def resize(polys, in_size, out_size):
      """Resize polygons according to image resize operation.
  
      Parameters
      ----------
      polys : list of numpy.ndarray
          Numpy.ndarray with shape (N, 2) where N is the number of bounding boxes.
          The second axis represents points of the polygons.
          Specifically, these are :math:`(x, y)`.
      in_size : tuple
          Tuple of length 2: (width, height) for input.
      out_size : tuple
          Tuple of length 2: (width, height) for output.
  
      Returns
      -------
      list of numpy.ndarray
          Resized polygons with original shape.
      """
      if not len(in_size) == 2:
          raise ValueError(
              "in_size requires length 2 tuple, given {}".format(
                  len(in_size)
              )
          )
      if not len(out_size) == 2:
          raise ValueError(
              "out_size requires length 2 tuple, given {}".format(
                  len(out_size)
              )
          )
  
      polys = copy.deepcopy(polys)
      x_scale = 1.0 * out_size[0] / in_size[0]
      y_scale = 1.0 * out_size[1] / in_size[1]
      for poly in polys:
          poly[:, 0] = x_scale * poly[:, 0]
          poly[:, 1] = y_scale * poly[:, 1]
      return polys
  
imports: import copy
  import numpy
  from PIL import Image
  from ..mscoco.utils import try_import_pycocotools
label_desc: Use image node_id 2 for calling a global function with example usage: resize(polys, in_size, out_size) and returns: polys