def create_report(self):
        """
        Using a Jinja template (jinja_audit_email.html), create a report that can be emailed.
        :return: HTML - The output of the rendered template.
        """
        jenv = get_jinja_env()
        template = jenv.get_template('jinja_audit_email.html')
        # This template expects a list of items that have been sorted by total score in
        # descending order.
        for item in self.items:
            item.totalscore = 0
            for issue in item.db_item.issues:
                item.totalscore = item.totalscore + issue.score
        sorted_list = sorted(self.items, key=lambda item: item.totalscore)
        sorted_list.reverse()
        report_list = []
        for item in sorted_list:
            if item.totalscore > 0:
                report_list.append(item)
            else:
                break
        if len(report_list) > 0:
            return template.render({'items': report_list})
        else:
            return False
dataset/ETHPy150Open Netflix/security_monkey/security_monkey/auditor.py/Auditor.create_report/original