def display_candidates(self, candidates, pdf_file=None):
if not pdf_file:<EOL><INDENT>pdf_file = os.path.join(<EOL>self.pdf_path, candidates[<NUM_LIT:0>][<NUM_LIT:0>].context.sentence.document.name<EOL>)<EOL>if os.path.isfile(pdf_file + "<STR_LIT>"):<EOL><INDENT>pdf_file += "<STR_LIT>"<EOL><DEDENT>elif os.path.isfile(pdf_file + "<STR_LIT>"):<EOL><INDENT>pdf_file += "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>logger.error("<STR_LIT>")<EOL><DEDENT><DEDENT>boxes = [<EOL>get_box(mention.context) for c in candidates for mention in c.get_mentions()<EOL>]<EOL>imgs = self.display_boxes(pdf_file, boxes, alternate_colors=True)<EOL>return display(*imgs)<EOL>
Displays the bounding boxes corresponding to candidates on an image of the pdf
boxes is a list of 5-tuples (page, top, left, bottom, right)