code: def paste_mask_in_image(mask, box, im_h, im_w):
      # type: (Tensor, Tensor, int, int) -> Tensor
      TO_REMOVE = 1
      w = int(box[2] - box[0] + TO_REMOVE)
      h = int(box[3] - box[1] + TO_REMOVE)
      w = max(w, 1)
      h = max(h, 1)
  
      # Set shape to [batchxCxHxW]
      mask = mask.expand((1, 1, -1, -1))
  
      # Resize mask
      mask = F.interpolate(
          mask, size=(h, w), mode="bilinear", align_corners=False
      )
      mask = mask[0][0]
  
      im_mask = torch.zeros(
          (im_h, im_w), dtype=mask.dtype, device=mask.device
      )
      x_0 = max(box[0], 0)
      x_1 = min(box[2] + 1, im_w)
      y_0 = max(box[1], 0)
      y_1 = min(box[3] + 1, im_h)
  
      im_mask[y_0:y_1, x_0:x_1] = mask[
          (y_0 - box[1]) : (y_1 - box[1]),
          (x_0 - box[0]) : (x_1 - box[0]),
      ]
      return im_mask
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn.functional
  import torchvision
  from torch import nn, Tensor
  from torchvision.ops import boxes, roi_align
  from .None import _utils
label_desc: Use image node_id 15 for calling a global function with example usage: paste_mask_in_image(mask, box, im_h, im_w) and returns: im_mask