Makes a html report and saves it into the same folder where logs are stored.
965493
def make_report(self):
        
        if self.execution_stats is None:
            raise RuntimeError('Cannot produce a report without running the executor first, check EOExecutor.run '
                               'method')

        if os.environ.get('DISPLAY', '') == '':
            LOGGER.info('No display found, using non-interactive Agg backend')
            plt.switch_backend('Agg')

        dependency_graph = self._create_dependency_graph()
        task_descriptions = self._get_task_descriptions()

        formatter = HtmlFormatter(linenos=True)
        task_source = self._render_task_source(formatter)
        execution_stats = self._render_execution_errors(formatter)

        template = self._get_template()

        html = template.render(dependency_graph=dependency_graph,
                               task_descriptions=task_descriptions,
                               task_source=task_source,
                               execution_stats=execution_stats,
                               execution_logs=self.execution_logs,
                               code_css=formatter.get_style_defs())

        if not os.path.isdir(self.report_folder):
            os.mkdir(self.report_folder)

        with open(self.get_report_filename(), 'w') as fout:
            fout.write(html)
1299800
def save(self, heads, console=True):
        
        # Junit
        self._save_junit()
        # HTML
        self._save_html_report(heads)
        if console:
            # Console print
            self._print_console_summary()
225468
def save_html(self, filename=None, overwrite=False):
        

        if filename is None:
            raise ValueError('Please provide a filename, e.g. viz.save_html(filename="viz.html").')

        import os
        base = self._html
        js = self.load_embed()
        if os.path.exists(filename):
            if overwrite is False:
                raise ValueError("File '%s' exists. To ovewrite call save_html with overwrite=True."
                                 % os.path.abspath(filename))
            else:
                os.remove(filename)
        with open(filename, "wb") as f:
            f.write(base.encode('utf-8'))
            f.write('<script>' + js.encode('utf-8') + '</script>')
582046
private void createReportInfo() {
        logger.entering();

        HSSFSheet summarySheet = wb.createSheet(ReportSheetNames.TESTSUMMARYREPORT.getName());

        Map<String, String> reportInfo = new LinkedHashMap<String, String>();

        for (Entry<String, String> temp : ConfigSummaryData.getConfigSummary().entrySet()) {
            reportInfo.put(temp.getKey(), temp.getValue());
        }

        int rowNum = 0;
        HSSFCell col;
        HSSFRow row;
        for (Entry<String, String> eachReportInfo : reportInfo.entrySet()) {
            int colNum = 2;
            row = summarySheet.createRow(rowNum++);

            col = row.createCell(colNum);
            col.setCellStyle(Styles.getSubHeading2Style());
            col.setCellValue(eachReportInfo.getKey());

            // Next column holds the values
            col = row.createCell(++colNum);
            col.setCellStyle(Styles.getThinBorderStyle());
            col.setCellValue(eachReportInfo.getValue());
        }

        logger.exiting();
    }
1061379
def save_all
      reports = to_h
      reports.each do |file, report|
        File.write(file, report)
      end

      reports.keys
    end
612254
public function export()
    {
        $path = $this->module->dataPath;
        FileHelper::createDirectory($path, $this->module->dirMode);

        $summary = $this->collectSummary();
        $dataFile = "$path/{$this->tag}.log";
        $data = [];

        $data['log'] = $this->save();

        $data['summary'] = $summary;
        file_put_contents($dataFile, $this->convertArrayToText($data));
        if ($this->module->fileMode !== null) {
            @chmod($dataFile, $this->module->fileMode);
        }

        $indexFile = "$path/index.data";
        $this->updateIndexFile($indexFile, $summary);
    }
584331
function saveFile(html) {
	fs.outputFile(options.outputFile, html, function(err, data) {
		if (err) {
			console.log(error('ERROR!'));
			console.dir(err);
			process.exit(1);
		}
		console.log(good('\n\nAll done!'));
		console.log('Created file: ' + good(options.outputFile));
	});
}
1068637
def display_results_html
		  output ="<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title></title></head><body>"
		  output.concat("<table><thead><tr><td>FileName</td></tr><tr><td>#{@folder1}</td></tr><tr><td>#{@folder2}</td></tr><tr><td>Equal</td></tr></thead>")
      @filehash.each{ |key, value| output.concat("<tbody><tr><td>#{value.file_name}</td></tr><tr><td>#{value.file_hash1}</td></tr><tr><td>#{value.file_hash2}</td></tr><tr><td>#{value.file_hash1==value.file_hash2}</td></tr>")}
      output.concat("</tbody></table></body></html>")
      puts output
    end
636384
def make_report(plots, settings):
    '''
    
    '''
    logging.info("Writing html report.")
    html_content = ['<body>']

    # Hyperlink Table of Contents panel
    html_content.append('<div class="panel panelC">')
    if settings["filtered"]:
        html_content.append(
            '<p><strong><a href="#stats0">Summary Statistics prior to filtering</a></strong></p>')
        html_content.append(
            '<p><strong><a href="#stats1">Summary Statistics after filtering</a></strong></p>')
    else:
        html_content.append(
            '<p><strong><a href="#stats0">Summary Statistics</a></strong></p>')
    html_content.append('<p><strong><a href="#plots">Plots</a></strong></p>')
    html_content.extend(['<p style="margin-left:20px"><a href="#' +
                         p.title.replace(' ', '_') + '">' + p.title + '</a></p>' for p in plots])
    html_content.append('</div>')

    # The report itself: stats
    html_content.append('<div class="panel panelM"> <h1>NanoPlot report</h1>')
    if settings["filtered"]:
        html_content.append('<h2 id="stats0">Summary statistics prior to filtering</h2>')
        html_content.append(utils.stats2html(settings["statsfile"][0]))
        html_content.append('<h2 id="stats1">Summary statistics after filtering</h2>')
        html_content.append(utils.stats2html(settings["statsfile"][1]))
    else:
        html_content.append('<h2 id="stats0">Summary statistics</h2>')
        html_content.append(utils.stats2html(settings["statsfile"][0]))

    # The report itself: plots
    html_content.append('<h2 id="plots">Plots</h2>')
    for plot in plots:
        html_content.append('\n<h3 id="' + plot.title.replace(' ', '_') + '">' +
                            plot.title + '</h3>\n' + plot.encode())
        html_content.append('\n<br>\n<br>\n<br>\n<br>')
    html_body = '\n'.join(html_content) + '</div></body></html>'
    html_str = utils.html_head + html_body
    htmlreport = settings["path"] + "NanoPlot-report.html"
    with open(htmlreport, "w") as html_file:
        html_file.write(html_str)
    return htmlreport
1191406
def save(callLog, logFilename):
    
    with open(logFilename, "wb") as outp:
      cPickle.dump(callLog, outp)
855810
def create_html(self, fname, title="ClassTracker Statistics"):
        
        # Create a folder to store the charts and additional HTML files.
        self.basedir = os.path.dirname(os.path.abspath(fname))
        self.filesdir = os.path.splitext(fname)[0] + '_files'
        if not os.path.isdir(self.filesdir):
            os.mkdir(self.filesdir)
        self.filesdir = os.path.abspath(self.filesdir)
        self.links = {}

        # Annotate all snapshots in advance
        self.annotate()

        # Create charts. The tags to show the images are returned and stored in
        # the self.charts dictionary. This allows to return alternative text if
        # the chart creation framework is not available.
        self.charts = {}
        fn = os.path.join(self.filesdir, 'timespace.png')
        self.charts['snapshots'] = self.create_snapshot_chart(fn)

        for fp, idx in zip(self.snapshots, list(range(len(self.snapshots)))):
            fn = os.path.join(self.filesdir, 'fp%d.png' % (idx))
            self.charts[fp] = self.create_pie_chart(fp, fn)

        for cn in list(self.index.keys()):
            fn = os.path.join(self.filesdir, cn.replace('.', '_')+'-lt.png')
            self.charts[cn] = self.create_lifetime_chart(cn, fn)

        # Create HTML pages first for each class and then the index page.
        for cn in list(self.index.keys()):
            fn = os.path.join(self.filesdir, cn.replace('.', '_')+'.html')
            self.links[cn]  = fn
            self.print_class_details(fn, cn)

        self.create_title_page(fname, title=title)
506108
def to_file(self, slug, folderpath=None, header=None, footer=None):
        
        if folderpath is None:
            if self.report_path is None:
                self.err(
                    "Please set the report_path parameter or pass a path in arguments")
                return
            folderpath = self.report_path
        else:
            self.report_path = folderpath
        html = self._get_header(header)
        if html is None or html == "":
            self.err(self.to_file, "Can not get html header")
        for report in self.reports:
            if "html" not in report:
                self.err("No html for report " + report)
                self.reports = self.report_engines = []
                return
            html += report["html"]
        html += self._get_footer(footer)
        try:
            path = self._write_file(slug, folderpath, html)
            path = "file://" + path
        except Exception as e:
            self.err(e, self.to_file, "Can not save report to file")
            return
        self.reports = []
        self.report_engines = []
        if self.notebook is True:
            link = '<a href="' + path + '" target="_blank">' + path + '</a>'
            return display(HTML(link))
793422
def save(connection, generate_now = false)
      xml = %(<ReportSaveRequest session-id="#{connection.session_id}" generate-now="#{generate_now ? 1 : 0}">)
      xml << to_xml
      xml << '</ReportSaveRequest>'
      response = connection.execute(xml)
      if response.success
        @id = response.attributes['reportcfg-id'].to_i
      end
    end
901965
def log_to_file(self, message):
        """"""

        with self.build_fs.open(self.log_file, 'a+') as f:
            f.write(unicode(message + '\n'))
757619
def write_report(self, force=False):
        '''
        
        '''
        path = self.title + '.html'
        value = self._template.format(
            title=self.title, body=self.body, sidebar=self.sidebar)
        write_file(path, value, force=force)
        plt.ion()
976198
def render_html_report(summary, report_template=None, report_dir=None):
    
    if not report_template:
        report_template = os.path.join(
            os.path.abspath(os.path.dirname(__file__)),
            "templates",
            "report_template.html"
        )
        logger.log_debug("No html report template specified, use default.")
    else:
        logger.log_info("render with html report template: {}".format(report_template))

    logger.log_info("Start to render Html report ...")

    report_dir = report_dir or os.path.join(os.getcwd(), "reports")
    if not os.path.isdir(report_dir):
        os.makedirs(report_dir)

    start_at_timestamp = int(summary["time"]["start_at"])
    summary["time"]["start_datetime"] = datetime.fromtimestamp(start_at_timestamp).strftime('%Y-%m-%d %H:%M:%S')

    report_path = os.path.join(report_dir, "{}.html".format(start_at_timestamp))

    with io.open(report_template, "r", encoding='utf-8') as fp_r:
        template_content = fp_r.read()
        with io.open(report_path, 'w', encoding='utf-8') as fp_w:
            rendered_content = Template(
                template_content,
                extensions=["jinja2.ext.loopcontrols"]
            ).render(summary)
            fp_w.write(rendered_content)

    logger.log_info("Generated Html report: {}".format(report_path))

    return report_path
846605
def dump_data(logdir):
  """"""
  # Create a tfevents file in the logdir so it is detected as a run.
  write_empty_event_file(logdir)

  plugin_logdir = plugin_asset_util.PluginDirectory(
      logdir, profile_plugin.ProfilePlugin.plugin_name)
  _maybe_create_directory(plugin_logdir)

  for run in profile_demo_data.RUNS:
    run_dir = os.path.join(plugin_logdir, run)
    _maybe_create_directory(run_dir)
    if run in profile_demo_data.TRACES:
      with open(os.path.join(run_dir, 'trace'), 'w') as f:
        proto = trace_events_pb2.Trace()
        text_format.Merge(profile_demo_data.TRACES[run], proto)
        f.write(proto.SerializeToString())

    if run not in profile_demo_data.TRACE_ONLY:
      shutil.copyfile('tensorboard/plugins/profile/profile_demo.op_profile.json',
                      os.path.join(run_dir, 'op_profile.json'))
      shutil.copyfile(
          'tensorboard/plugins/profile/profile_demo.memory_viewer.json',
          os.path.join(run_dir, 'memory_viewer.json'))
      shutil.copyfile(
          'tensorboard/plugins/profile/profile_demo.pod_viewer.json',
          os.path.join(run_dir, 'pod_viewer.json'))
      shutil.copyfile(
          'tensorboard/plugins/profile/profile_demo.google_chart_demo.json',
          os.path.join(run_dir, 'google_chart_demo.json'))

  # Unsupported tool data should not be displayed.
  run_dir = os.path.join(plugin_logdir, 'empty')
  _maybe_create_directory(run_dir)
  with open(os.path.join(run_dir, 'unsupported'), 'w') as f:
    f.write('unsupported data')