def union(bboxes):
assert(len(bboxes))<EOL>if len(bboxes) == <NUM_LIT:1>:<EOL><INDENT>return bboxes[<NUM_LIT:0>]<EOL><DEDENT>x0 = np.inf<EOL>y0 = np.inf<EOL>x1 = -np.inf<EOL>y1 = -np.inf<EOL>for bbox in bboxes:<EOL><INDENT>points = bbox.get_points()<EOL>xs = points[:, <NUM_LIT:0>]<EOL>ys = points[:, <NUM_LIT:1>]<EOL>x0 = min(x0, np.min(xs))<EOL>y0 = min(y0, np.min(ys))<EOL>x1 = max(x1, np.max(xs))<EOL>y1 = max(y1, np.max(ys))<EOL><DEDENT>return Bbox.from_extents(x0, y0, x1, y1)<EOL>
Return a :class:`Bbox` that contains all of the given bboxes.