code: def resize(
      image: Tensor,
      target: dict,
      size: Union[int, List[int]],
      max_size: Optional[int] = None,
  ):
      # size can be min_size (scalar) or (w, h) tuple
  
      size = get_size(image.size, size, max_size)
      rescaled_image = F.resize(image, size)
  
      if target is None:
          return rescaled_image, None
  
      ratios = tuple(
          float(s) / float(s_orig)
          for s, s_orig in zip(rescaled_image.size, image.size)
      )
      ratio_width, ratio_height = ratios
  
      target = target.copy()
      if "boxes" in target:
          boxes = target["boxes"]
          scaled_boxes = boxes * torch.as_tensor(
              [ratio_width, ratio_height, ratio_width, ratio_height]
          )
          target["boxes"] = scaled_boxes
  
      if "area" in target:
          area = target["area"]
          scaled_area = area * (ratio_width * ratio_height)
          target["area"] = scaled_area
  
      h, w = size
      target["size"] = torch.tensor([h, w])
  
      return rescaled_image, target
  
imports: import random
  from typing import List, Optional, Union
  import torch
  import torchvision.transforms
  import torchvision.transforms.functional
  from mmf.common.registry import registry
  from mmf.datasets.processors.processors import BaseProcessor
  from mmf.utils.box_ops import box_xyxy_to_cxcywh
  from torch import Tensor
label_desc: Use image node_id 5 for calling a global function with example usage: resize(image, target, size, max_size) and returns: rescaled_image,  target, rescaled_image,  None