Generates a HTML summary that shows the gains, loses or ties of each
algorithm against each other, in a specific measure..
976971
public void computeWinsTiesLossesHTML(String path) {

        List<Algorithm> alg = this.streams.get(0).algorithm;
        int algorithmSize = this.streams.get(0).algorithm.size();
        String tablaSalida = "";
        tablaSalida += "<TABLE BORDER=1 WIDTH=\"100%\" ALIGN=CENTER>\n";
        tablaSalida += "<CAPTION> Experiment";
        tablaSalida += "<TR> <TD ROWSPAN = 2>Algorithm <TD TD ROWSPAN = 2>PM";

        for (int i = 1; i < algorithmSize; i++) {
            tablaSalida += "<TD COLSPAN = 3>" + alg.get(i).name;
        }
        tablaSalida += "<TD>AVG";
        tablaSalida += "<TR>";
        for (int i = 1; i < algorithmSize; i++) {
            tablaSalida += "<TD>" + "Wins" + "<TD>" + "Losses" + "<TD>" + "Ties";
        }
        for (int i = 0; i < algorithmSize; i++) {
            tablaSalida += "<TR><TD ROWSPAN = " + alg.get(i).measures.size() + ">" + alg.get(i).name;
            List<Measure> measureRow[] = alg.get(i).getMeasuresPerData(streams);
            int cont = 0;
            while (cont != this.streams.get(0).algorithm.get(i).measures.size()) {

                //String name = measureRow[i].get(cont).getName();
                String name = alg.get(i).measures.get(cont).getName();
                tablaSalida += "<TD>" + name;
                double sum = 0.0;

                for (int j = 1; j < algorithmSize; j++) {
                    List<Measure> measureCol[] = alg.get(j).getMeasuresPerData(streams);
                    int win = 0, losses = 0, ties = 0;
                    for (int k = 0; k < measureCol.length; k++) {
                        double alg1 = measureRow[k].get(cont).getValue();
                        double alg2 = measureCol[k].get(cont).getValue();
                        if (j == 1) {
                            sum += measureRow[k].get(cont).getValue();
                        }
                        if (measureRow[k].get(cont).isType()) {
                            if (Algorithm.Round(alg1) > Algorithm.Round(alg2)) {
                                win++;
                            } else if (Algorithm.Round(alg1) < Algorithm.Round(alg2)) {
                                losses++;
                            } else {
                                ties++;
                            }
                        } else {
                            if (alg1 < alg2) {
                                win++;
                            } else if (alg1 > alg2) {
                                losses++;
                            } else {
                                ties++;
                            }
                        }

                    }

                    if (i < j) {
                        tablaSalida += "<TD>" + win;
                        tablaSalida += "<TD>" + losses;
                        tablaSalida += "<TD>" + ties;
                    } else {
                        tablaSalida += "<TD> ";
                        tablaSalida += "<TD> ";
                        tablaSalida += "<TD> ";
                    }

                }

                sum = (double) sum / measureRow.length;
                tablaSalida += "<TD>" + Algorithm.format(sum);
                tablaSalida += "<TR>";
                cont++;
            }

        }
        tablaSalida += "</TABLE>";
//        PrintStream salida = null;
//        try {
//            salida = new PrintStream(new BufferedOutputStream(new FileOutputStream(path + "summary.win.ties.losses.html")));
//        } catch (FileNotFoundException ex) {
//            Logger.getLogger(Summary.class.getName()).log(Level.SEVERE, null, ex);
//        }
//        System.setOut(salida);
//        System.out.println(tablaSalida);
//        salida.close();
          try {
            BufferedWriter out = new BufferedWriter(new FileWriter(path + "summary.win.ties.losses.html"));
            out.write(tablaSalida);  //Replace with the string 
            //you are trying to write  
            out.close();
        } catch (IOException e) {
            System.out.println("Error saving summary.win.ties.losses.html");

        }
        

    }
1299651
def _aggregate(self, tests_results):
        
        summary = {
            "success": True,
            "stat": {
                "testcases": {
                    "total": len(tests_results),
                    "success": 0,
                    "fail": 0
                },
                "teststeps": {}
            },
            "time": {},
            "platform": report.get_platform(),
            "details": []
        }

        for tests_result in tests_results:
            testcase, result = tests_result
            testcase_summary = report.get_summary(result)

            if testcase_summary["success"]:
                summary["stat"]["testcases"]["success"] += 1
            else:
                summary["stat"]["testcases"]["fail"] += 1

            summary["success"] &= testcase_summary["success"]
            testcase_summary["name"] = testcase.config.get("name")
            testcase_summary["in_out"] = utils.get_testcase_io(testcase)

            report.aggregate_stat(summary["stat"]["teststeps"], testcase_summary["stat"])
            report.aggregate_stat(summary["time"], testcase_summary["time"])

            summary["details"].append(testcase_summary)

        return summary
597836
def render_summary(self, include_title=True, request=None):
        """"""
        title = ''
        frames = []
        classes = ['traceback']
        if not self.frames:
            classes.append('noframe-traceback')

        if include_title:
            if self.is_syntax_error:
                title = text_('Syntax Error')
            else:
                title = text_('Traceback <small>(most recent call last)'
                              '</small>')

        for frame in self.frames:
            frames.append(
                text_('<li%s>%s') % (
                    frame.info and text_(' title="%s"' % escape(frame.info)) or
                    text_(''),
                    frame.render()
                ))

        if self.is_syntax_error:
            description_wrapper = text_('<pre class=syntaxerror>%s</pre>')
        else:
            description_wrapper = text_('<blockquote>%s</blockquote>')

        vars = {
            'classes': text_(' '.join(classes)),
            'title': title and text_('<h3 class="traceback">%s</h3>'
                                     % title) or text_(''),
            'frames': text_('\n'.join(frames)),
            'description': description_wrapper % escape(self.exception),
        }
        app = request.app
        template = app.ps.jinja2.env.get_template('debugtoolbar/exception_summary.html')
        return template.render(app=app, request=request, **vars)
314417
def _summaries(self):
        
        for var in tf.trainable_variables():
            tf.summary.histogram(var.name, var)
            print(var.name)
1371181
def get_gain_loss_summary(vcffile):
    
    from cyvcf2 import VCF

    counter = Counter()
    for v in VCF(vcffile):
        tag = v.ID.split(":")[1]
        counter[tag] += 1

    return counter
1093237
function writeSummary(output) {
    var options = output.getOptions();
    var prefix = options.get('prefix');

    var filePath = SUMMARY_FILE;
    var engine = WebsiteGenerator.createTemplateEngine(output, filePath);
    var context = JSONUtils.encodeOutput(output);

    // Render the theme
    return Templating.renderFile(engine, prefix + '/summary.html', context)

    // Write it to the disk
    .then(function(tplOut) {
        return writeFile(output, filePath, tplOut.getContent());
    });
}
983322
function displaySummary(errorCode) {
    var error = errors[errorCode];
    if (error.count > 1) {
        console.log(getChalk(errorCode)('%s: %s (%d instances)'),
            errorCode, error.reason, error.count);
    } else {
        console.log(getChalk(errorCode)('%s: %s (1 instance)'),
            errorCode, error.reason);
    }
}
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
571411
def generate_liveOut_layout():
    ''
    return html.Div([
        dpd.Pipe(id="named_count_pipe",
                 value=None,
                 label="named_counts",
                 channel_name="live_button_counter"),
        html.Div(id="internal_state",
                 children="No state has been computed yet",
                 style={'display':'none'}),
        dcc.Graph(id="timeseries_plot"),
        dcc.Input(value=str(uuid.uuid4()),
                  id="state_uid",
                  style={'display':'none'},
                 )
        ])
1256302
def print_summary(graph, tails, node_id_map):
    """"""
    # Get comparison data
    heads = get_heads(tails)
    heights = get_heights(tails)
    max_height = max(heights)
    common_height, block_ids_at_common_height = get_common_height(tails)
    lags = get_lags(heights, max_height)
    common_ancestor = graph.root
    divergences = get_divergences(heights, graph.root)

    # Print summary info
    col_1 = 8
    col_n = 8
    format_str = '{:<' + str(col_1) + '} ' + ('{:<' + str(col_n) + '} ') * 2
    header = format_str.format("COMMON", "HEIGHT", "BLOCKS")
    print(header)
    print("-" * len(header))
    print(format_str.format(
        "ANCESTOR", common_ancestor.num, common_ancestor.ident[:col_n]))
    print(format_str.format(
        "HEIGHT", common_height, str(block_ids_at_common_height)))
    print()

    # Print per-node data
    node_col_width = get_col_width_for_num(len(tails), len("NODE"))
    num_col_width = get_col_width_for_num(max_height, len("HEIGHT"))
    lag_col_width = get_col_width_for_num(max(lags), len("LAG"))
    diverg_col_width = get_col_width_for_num(max(divergences), len("DIVERG"))

    format_str = (
        '{:<' + str(node_col_width) + '} '
        '{:<8} '
        '{:<' + str(num_col_width) + '} '
        '{:<' + str(lag_col_width) + '} '
        '{:<' + str(diverg_col_width) + '}'
    )

    header = format_str.format("NODE", "HEAD", "HEIGHT", "LAG", "DIVERG")
    print(header)
    print('-' * len(header))

    for i, _ in enumerate(tails):
        print(format_str.format(
            node_id_map[i],
            heads[i],
            heights[i],
            lags[i],
            divergences[i],
        ))
    print()
486096
private void obtainQualityMarks() {
        int total = 0;
        for (int i = 0; i < this.qualityScoresArray.length; i++) {
            total += this.qualityScoresArray[i];
            this.maximumQuality = Math.max(this.qualityScoresArray[i], this.maximumQuality);
            this.minimumQuality = Math.min(this.qualityScoresArray[i], this.minimumQuality);
        }
        this.averageQuality = (double) total / this.quality.length();
    }
384413
def display(self):
        
        print('Stats for %s from %s - %s' % (self.name, self.start, self.end))
        if type(self.rf) is float:
            print('Annual risk-free rate considered: %s' % (fmtp(self.rf)))
        print('Summary:')
        data = [[fmtp(self.total_return), fmtn(self.daily_sharpe),
                 fmtp(self.cagr), fmtp(self.max_drawdown)]]
        print(tabulate(data, headers=['Total Return', 'Sharpe',
                                      'CAGR', 'Max Drawdown']))

        print('\nAnnualized Returns:')
        data = [[fmtp(self.mtd), fmtp(self.three_month), fmtp(self.six_month),
                 fmtp(self.ytd), fmtp(self.one_year), fmtp(self.three_year),
                 fmtp(self.five_year), fmtp(self.ten_year),
                 fmtp(self.incep)]]
        print(tabulate(data,
                       headers=['mtd', '3m', '6m', 'ytd', '1y',
                                '3y', '5y', '10y', 'incep.']))

        print('\nPeriodic:')
        data = [
            ['sharpe', fmtn(self.daily_sharpe), fmtn(self.monthly_sharpe),
             fmtn(self.yearly_sharpe)],
            ['mean', fmtp(self.daily_mean), fmtp(self.monthly_mean),
             fmtp(self.yearly_mean)],
            ['vol', fmtp(self.daily_vol), fmtp(self.monthly_vol),
             fmtp(self.yearly_vol)],
            ['skew', fmtn(self.daily_skew), fmtn(self.monthly_skew),
             fmtn(self.yearly_skew)],
            ['kurt', fmtn(self.daily_kurt), fmtn(self.monthly_kurt),
             fmtn(self.yearly_kurt)],
            ['best', fmtp(self.best_day), fmtp(self.best_month),
             fmtp(self.best_year)],
            ['worst', fmtp(self.worst_day), fmtp(self.worst_month),
             fmtp(self.worst_year)]]
        print(tabulate(data, headers=['daily', 'monthly', 'yearly']))

        print('\nDrawdowns:')
        data = [
            [fmtp(self.max_drawdown), fmtp(self.avg_drawdown),
             fmtn(self.avg_drawdown_days)]]
        print(tabulate(data, headers=['max', 'avg', '# days']))

        print('\nMisc:')
        data = [['avg. up month', fmtp(self.avg_up_month)],
                ['avg. down month', fmtp(self.avg_down_month)],
                ['up year %', fmtp(self.win_year_perc)],
                ['12m up %', fmtp(self.twelve_month_win_perc)]]
        print(tabulate(data))
1138737
public void outputTracerReport() {
    JvmMetrics.maybeWriteJvmMetrics(this.output, "verbose:pretty:all");
    calcTotalStats();

    ArrayList<Entry<String, Stats>> statEntries = new ArrayList<>();
    statEntries.addAll(this.summary.entrySet());
    Collections.sort(
        statEntries,
        new Comparator<Entry<String, Stats>>() {
          @Override
          public int compare(Entry<String, Stats> e1, Entry<String, Stats> e2) {
            return Long.compare(e1.getValue().runtime, e2.getValue().runtime);
          }
        });

    this.output.print(Joiner.on("\n").join(
        "\nTOTAL:",
        "Start time(ms): " + this.startTime,
        "End time(ms): " + this.endTime,
        "Wall time(ms): " + (this.endTime - this.startTime),
        "Passes runtime(ms): " + this.passesRuntime,
        "Max mem usage (measured after each pass)(MB): " + this.maxMem,
        "#Runs: " + this.runs,
        "#Changing runs: " + this.changes,
        "#Loopable runs: " + this.loopRuns,
        "#Changing loopable runs: " + this.loopChanges,
        "Estimated AST reduction(#nodes): " + this.astDiff,
        "Estimated Reduction(bytes): " + this.diff,
        "Estimated GzReduction(bytes): " + this.gzDiff,
        "Estimated AST size(#nodes): " + this.astSize,
        "Estimated Size(bytes): " + this.codeSize,
        "Estimated GzSize(bytes): " + this.gzCodeSize));

    this.output.print(Joiner.on("\n").join(
        "\n\nInputs:",
        "JS lines:   " + this.jsLines,
        "JS sources: " + this.jsSources,
        "Extern lines:   " + this.externLines,
        "Extern sources: " + this.externSources + "\n\n"));

    this.output.print("Summary:\n"
        + "pass,runtime,allocMem,runs,changingRuns,astReduction,reduction,gzReduction\n");
    for (Entry<String, Stats> entry : statEntries) {
      String key = entry.getKey();
      Stats stats = entry.getValue();
      this.output.print(SimpleFormat.format("%s,%d,%d,%d,%d,%d,%d,%d\n", key, stats.runtime,
            stats.allocMem, stats.runs, stats.changes, stats.astDiff, stats.diff, stats.gzDiff));
    }
    this.output.print("\n");

    this.output.print(Joiner.on("\n").join(
        "Log:",
        "pass,runtime,allocMem,codeChanged,astReduction,reduction,gzReduction,astSize,size,gzSize\n"));
    for (Stats stats : this.log) {
      this.output.print(SimpleFormat.format("%s,%d,%d,%b,%d,%d,%d,%d,%d,%d\n",
          stats.pass, stats.runtime, stats.allocMem, stats.changes == 1,
          stats.astDiff, stats.diff, stats.gzDiff, stats.astSize, stats.size, stats.gzSize));
    }
    this.output.print("\n");
    // this.output can be System.out, so don't close it to not lose subsequent
    // error messages. Flush to ensure that you will see the tracer report.
    try {
      // TODO(johnlenz): Remove this cast and try/catch.
      // This is here to workaround GWT http://b/30943295
      ((FilterOutputStream) this.output).flush();
    } catch (IOException e) {
      throw new RuntimeException("Unreachable.");
    }
  }
394499
public SummaryTable[] showSummary(){
        int cont = 0;
        int algorithmSize = this.streams.get(0).algorithm.size();
        int streamSize = this.streams.size();
        int measureSize = this.streams.get(0).algorithm.get(0).measures.size();
        summary = new SummaryTable[measureSize];
        while (cont != measureSize) {
           
            summary[cont] = new SummaryTable();
            summary[cont].measureName = this.streams.get(0).algorithm.get(0).measures.get(cont).getName();
            summary[cont].algNames = new String[algorithmSize+1];
            summary[cont].algNames[0] ="Algorithm";
            summary[cont].value = new Object[streamSize][algorithmSize+1];
           
            for (int i = 0; i < algorithmSize; i++) {
              
                summary[cont].algNames[i+1] = this.streams.get(0).algorithm.get(i).name;
            }
            for (int i = 0; i < streamSize; i++) {
                List<Algorithm> alg = this.streams.get(i).algorithm;
                 summary[cont].value[i][0] = this.streams.get(i).name;  
                for (int j = 0; j < algorithmSize; j++) {
                    if (alg.get(j).measures.get(cont).isType()) {
                        summary[cont].value[i][j+1] = Algorithm.format(alg.get(j).measures.get(cont).getValue())+"±"+
                                    Algorithm.format(alg.get(j).measures.get(cont).getStd());
                    } else {
                        summary[cont].value[i][j+1] = Algorithm.format1(alg.get(j).measures.get(cont).getValue());
                       
                    }
                }
               
            }
                   
            cont++;
        }
        return summary;
    }
1339573
def generateSummaryHTMLTable(self, extraLapse = TYPICAL_LAPSE):
		''' 
		'''
		scriptsRun = self.scriptsRun
		
		html = []
		html.append("<table style='text-align:center;border:1px solid black;margin-left: auto;margin-right: auto;'>\n") # Start summary table
		html.append('	<tr><td colspan="4" style="text-align:center"></td></tr>\n')
		html.append('	<tr style="font-weight:bold;background-color:#cccccc;text-align:center"><td>Script</td><td>Last status</td><td>Last run</td><td>Last success</td></tr>\n')
		
		# Alternate shades between rows
		tablestyle = ['background-color:#33dd33;', 'background-color:#33ff33;']
		warningstyle = ['background-color:#EA8737;', 'background-color:#f5b767;']
		failstyle = ['background-color:#dd3333;', 'background-color:#ff3333;']
		
		count = 0
		for name, details in sorted(scriptsRun.iteritems()):
			status = None
			
			rowstyle = tablestyle[count % 2]
			if details["lastSuccess"] and expectedScripts.get(name):
				if not expectedScripts.check(name, details["lastSuccess"], extraLapse): 
					status = "STOPPED"
			else:
				rowstyle = failstyle[count % 2]
				status = "FAIL"
				
			laststatusstyle = tablestyle[count % 2]
			if details["status"] & RETROSPECT_FAIL:
				laststatusstyle = failstyle[count % 2]
				status = "FAIL"
			elif status != "STOPPED" and details["status"] & RETROSPECT_WARNING:
				laststatusstyle = warningstyle[count % 2]
				status = "WARNINGS"
			elif status != "FAIL" and status != "STOPPED":
				status = "OK"
				
			# Start a row	
			html.append('<tr style="text-align:left;%s">\n' % rowstyle)
			
			# Script name field
			if status == "STOPPED":
				html.append('\t<td style="%s">%s</td>\n' % (failstyle[count % 2], name))
			else:
				html.append('\t<td style="%s">%s</td>' % (tablestyle[count % 2], name))
			
				
			# Last status field
			if details["lastRun"]:
				if status == "STOPPED":
					html.append('\t<td style="%s"><a href="#%s">%s</a></td>\n' % (failstyle[count % 2], self.createAnchorID(name, details["lastRun"]), status))
				else:
					html.append('\t<td style="%s"><a href="#%s">%s</a></td>\n' % (laststatusstyle, self.createAnchorID(name, details["lastRun"]), status))
			else:
				html.append('\t<td style="%s">%s</td>\n' % (laststatusstyle, status))
			
			# Last run field
			if details["lastRun"]:
				html.append('\t<td style="%s"><a href="#%s">%s</a></td>\n' % (laststatusstyle, self.createAnchorID(name, details["lastRun"]), details["lastRun"]))
			else:
				html.append('\t<td style="%s">none found</td>\n' % laststatusstyle)
			
			# Last success field
			if details["lastSuccess"]:
				html.append('\t<td><a href="#%s">%s</a></td>\n' % (self.createAnchorID(name, details["lastSuccess"]), details["lastSuccess"]))
			else:
				html.append('\t<td>none found</td>\n')
			html.append('</tr>\n')
			count += 1
		html.append("</table>")
		return html
243074
function(groupName, totalSites, totalPages,
                                totalPageviews) {
            var format = d3.format(',d');
            // build
            var summary = 
              '<tr>' +
              '<td>' + groupName + '</td>' +
              '<td>' + format(totalPageviews) + '</td>' +
              '<td>' + format(totalPages) + '</td>' +
              //'<td>' + totalSites + '</td>' +
              '</tr>';

            return summary;
        }
1313042
function renderSummary(totalErrors, totalWarnings) {
  var totalProblems = totalErrors + totalWarnings;
  var renderedText = totalProblems + ' ' + pluralize('problem', totalProblems);

  if (totalProblems !== 0) {
    renderedText += ' (' + totalErrors + ' ' + pluralize('error', totalErrors) + ', ' + totalWarnings + ' ' + pluralize('warning', totalWarnings) + ')';
  }
  return renderedText;
}