code: def uniform_crop_with_boxes(
      images: torch.Tensor,
      size: int,
      spatial_idx: int,
      boxes: torch.Tensor,
  ) -> Tuple[torch.Tensor, np.ndarray]:
      """
      Perform uniform spatial sampling on the images and corresponding boxes.
      Args:
          images (tensor): images to perform uniform crop. The dimension is
              `channel` x `num frames` x `height` x `width`.
          size (int): size of height and weight to crop the images.
          spatial_idx (int): 0, 1, or 2 for left, center, and right crop if width
              is larger than height. Or 0, 1, or 2 for top, center, and bottom
              crop if height is larger than width.
          boxes (tensor): Corresponding boxes to images.
              Dimension is `num boxes` x 4.
      Returns:
          cropped (tensor): images with dimension of
              `channel` x `num frames` x `height` x `width`.
          cropped_boxes (tensor): the cropped boxes with dimension of
              `num boxes` x 4.
      """
      cropped, x_offset, y_offset = _uniform_crop_helper(
          images, size, spatial_idx
      )
      cropped_boxes = crop_boxes(boxes, x_offset, y_offset)
      return cropped, clip_boxes_to_image(
          cropped_boxes, cropped.shape[-2], cropped.shape[-1]
      )
  
imports: import copy
  import math
  from typing import Tuple
  import numpy
  import torch
label_desc: Use image node_id 11 for calling a global function with example usage: uniform_crop_with_boxes(images, size, spatial_idx, boxes) and returns: cropped,  clip_boxes_to_image