code: def calculate_box_union(
      box1: Union[List[int], np.ndarray],
      box2: Union[List[int], np.ndarray],
  ) -> List[int]:
      """
      Args:
          box1 (List[int]): [x1, y1, x2, y2]
          box2 (List[int]): [x1, y1, x2, y2]
      """
      box1 = np.array(box1)
      box2 = np.array(box2)
      left_top = np.minimum(box1[:2], box2[:2])
      right_bottom = np.maximum(box1[2:], box2[2:])
      return list(np.concatenate((left_top, right_bottom)))
  
imports: from collections.abc import Sequence
  from typing import List, Union
  import numpy
  import torch
  from sahi.annotation import BoundingBox, Category, Mask
  from sahi.prediction import ObjectPrediction
label_desc: Use image node_id 3 for calling a global function with example usage: calculate_box_union(box1, box2) and returns: list