code: def horizontal_flip(prob, images, boxes=None):
      """
      Perform horizontal flip on the given images and corresponding boxes.
      Args:
          prob (float): probility to flip the images.
          images (tensor): images to perform horizontal flip, the dimension is
              `num frames` x `channel` x `height` x `width`.
          boxes (ndarray or None): optional. Corresponding boxes to images.
              Dimension is `num boxes` x 4.
      Returns:
          images (tensor): images with dimension of
              `num frames` x `channel` x `height` x `width`.
          flipped_boxes (ndarray or None): the flipped boxes with dimension of
              `num boxes` x 4.
      """
      if boxes is None:
          flipped_boxes = None
      else:
          flipped_boxes = boxes.copy()
  
      if np.random.uniform() < prob:
          images = images.flip((-1))
  
          if len(images.shape) == 3:
              width = images.shape[2]
          elif len(images.shape) == 4:
              width = images.shape[3]
          else:
              raise NotImplementedError("Dimension does not supported")
          if boxes is not None:
              flipped_boxes[:, [0, 2]] = width - boxes[:, [2, 0]] - 1
  
      return images, flipped_boxes
  
imports: import logging
  import math
  import numpy
  import random
  import torch
  import torchvision
  import torchvision.transforms.functional
  from PIL import Image, ImageFilter
  from scipy.ndimage import gaussian_filter
  from torchvision import transforms
  from .rand_augment import rand_augment_transform
  from .random_erasing import RandomErasing
label_desc: Use image node_id 5 for calling a global function with example usage: horizontal_flip(prob, images, boxes) and returns: images,  flipped_boxes