code: def spatial_shift_crop_list(
      size, images, spatial_shift_pos, boxes=None
  ):
      """
      Perform left, center, or right crop of the given list of images.
      Args:
          size (int): size to crop.
          image (list): ilist of images to perform short side scale. Dimension is
              `height` x `width` x `channel` or `channel` x `height` x `width`.
          spatial_shift_pos (int): option includes 0 (left), 1 (middle), and
              2 (right) crop.
          boxes (list): optional. Corresponding boxes to images.
              Dimension is `num boxes` x 4.
      Returns:
          cropped (ndarray): the cropped list of images with dimension of
              `height` x `width` x `channel`.
          boxes (list): optional. Corresponding boxes to images. Dimension is
              `num boxes` x 4.
      """
  
      assert spatial_shift_pos in [0, 1, 2]
  
      height = images[0].shape[0]
      width = images[0].shape[1]
      y_offset = int(math.ceil((height - size) / 2))
      x_offset = int(math.ceil((width - size) / 2))
  
      if height > width:
          if spatial_shift_pos == 0:
              y_offset = 0
          elif spatial_shift_pos == 2:
              y_offset = height - size
      else:
          if spatial_shift_pos == 0:
              x_offset = 0
          elif spatial_shift_pos == 2:
              x_offset = width - size
  
      cropped = [
          image[
              y_offset : y_offset + size, x_offset : x_offset + size, :
          ]
          for image in images
      ]
      assert (
          cropped[0].shape[0] == size
      ), "Image height not cropped properly"
      assert (
          cropped[0].shape[1] == size
      ), "Image width not cropped properly"
  
      if boxes is not None:
          for i in range(len(boxes)):
              boxes[i][:, [0, 2]] -= x_offset
              boxes[i][:, [1, 3]] -= y_offset
      return cropped, boxes
  
imports: import math
  import numpy
  import cv2
label_desc: Use image node_id 6 for calling a global function with example usage: spatial_shift_crop_list(size, images, spatial_shift_pos, boxes) and returns: cropped,  boxes