def get_intersection(bbox1, bbox2):
intersection = []<EOL>page_1, page_width, page_height, top_1, left_1, bottom_1, right_1 = bbox1<EOL>page_2, _, _, top_2, left_2, bottom_2, right_2 = bbox2<EOL>if page_1 == page_2:<EOL><INDENT>if doOverlap(<EOL>(top_1, left_1, bottom_1, right_1), (top_2, left_2, bottom_2, right_2)<EOL>):<EOL><INDENT>intersection += [<EOL>(<EOL>page_1,<EOL>page_width,<EOL>page_height,<EOL>max(top_1, top_2),<EOL>max(left_1, left_2),<EOL>min(bottom_1, bottom_2),<EOL>min(right_1, right_2),<EOL>)<EOL>]<EOL><DEDENT><DEDENT>return intersection<EOL>
:param bbox1: (page, width, height, top, left, bottom, right)
:param bbox2: (page, width, height, top, left, bottom, right)
:return: intersection if bboxes are in the same page and intersect