code: def rerec(bboxA):
      h = bboxA[:, 3] - bboxA[:, 1]
      w = bboxA[:, 2] - bboxA[:, 0]
  
      l = torch.max(w, h)
      bboxA[:, 0] = bboxA[:, 0] + w * 0.5 - l * 0.5
      bboxA[:, 1] = bboxA[:, 1] + h * 0.5 - l * 0.5
      bboxA[:, 2:4] = bboxA[:, :2] + l.repeat(2, 1).permute(1, 0)
  
      return bboxA
  
imports: import torch
  from torch.nn.functional import interpolate
  from torchvision.transforms import functional
  from torchvision.ops.boxes import batched_nms
  from PIL import Image
  import numpy
  import os
  import math
label_desc: Use image node_id 8 for calling a global function with example usage: rerec(bboxA) and returns: bboxA