def get_outer_bounding_boxes(rectangles):
if len(rectangles) == <NUM_LIT:0>:<EOL><INDENT>return []<EOL><DEDENT>outer_bboxes = [rectangles[<NUM_LIT:0>]]<EOL>for bbox2 in rectangles[<NUM_LIT:1>:]:<EOL><INDENT>overlap_indexes = []<EOL>for i, bbox1 in enumerate(outer_bboxes):  <EOL><INDENT>if doOverlap(bbox1, bbox2):<EOL><INDENT>overlap_indexes.append(i)<EOL><DEDENT><DEDENT>for i in overlap_indexes:<EOL><INDENT>bbox2 = mergeBboxes(bbox2, outer_bboxes[i])<EOL><DEDENT>for i in sorted(overlap_indexes, reverse=True):<EOL><INDENT>del outer_bboxes[i]<EOL><DEDENT>outer_bboxes.append(bbox2)<EOL><DEDENT>return outer_bboxes<EOL>
:param rectangles: list of bounding boxes (top, left, bottom, right)
:return: outer bounding boxes (only the largest bbox when bboxes intersect)