def METHOD_NAME(self, filename=None, embed=False):
    from ..visualization.widget import ScanReportWidget
    widget = ScanReportWidget(self)
    html = widget.render_html(embed=embed)
    if filename is not None:
        with open(filename, "w") as f:
            f.write(html)
        return
    return html