code: def display_boxes(self, pdf_file, boxes, alternate_colors=False):
          
          imgs = []
          colors = [Color("blue"), Color("red")]
          boxes_per_page = defaultdict(int)
          boxes_by_page = defaultdict(list)
          for i, (page, top, left, bottom, right) in enumerate(boxes):
              boxes_per_page[page] += 1
              boxes_by_page[page].append((top, left, bottom, right))
          for i, page_num in enumerate(boxes_per_page.keys()):
              img = pdf_to_img(pdf_file, page_num)
              draw = Drawing()
              draw.fill_color = Color("rgba(0, 0, 0, 0.0)")
              for j, (top, left, bottom, right) in enumerate(boxes_by_page[page_num]):
                  draw.stroke_color = colors[j % 2] if alternate_colors else colors[0]
                  draw.rectangle(left=left, top=top, right=right, bottom=bottom)
              draw(img)
              imgs.append(img)
          return imgs
docs: Displays each of the bounding boxes passed in 'boxes' on images of the pdf
          pointed to by pdf_file
          boxes is a list of 5-tuples (page, top, left, bottom, right)