def sum_bbox(bbox1, bbox2):
  """Summarizes two bounding boxes. The result will be bounding box which
  contains both provided bboxes.

  :type bbox1: list
  :param bbox1: first bounding box

  :type bbox2: list
  :param bbox2: second bounding box

  :rtype: list
  :return: new bounding box
  """
  if not bbox1 or not bbox2:
    return bbox1 + bbox2
  x0, y0, x1, y1 = bbox1
  _x0, _y0, _x1, _y1 = bbox2
  new_x0 = min(x0, _x0, x1, _x1)
  new_x1 = max(x0, _x0, x1, _x1)
  new_y0 = min(y0, _y0, y1, _y1)
  new_y1 = max(y0, _y0, y1, _y1)
  return [new_x0, new_y0, new_x1, new_y1]