Retrieve an HTML table report of current selected analysis.
978836
def analysis_summary_report(feature, parent):
    
    _ = feature, parent  # NOQA
    project_context_scope = QgsExpressionContextUtils.projectScope(
        QgsProject.instance())
    key = provenance_layer_analysis_impacted['provenance_key']
    if not project_context_scope.hasVariable(key):
        return None

    analysis_dir = dirname(project_context_scope.variable(key))
    return get_impact_report_as_string(analysis_dir)
979216
def analysis(self, analysis_id: int) -> models.Analysis:
        """"""
        return self.Analysis.query.get(analysis_id)
593280
def extract(self, html):
        ""
        extracted = {}
        soup = BeautifulSoup(html, parser)
        for meta_tag in soup.find_all('meta'):
            if self.key_attr in meta_tag.attrs and 'content' in meta_tag.attrs and \
                meta_tag[self.key_attr].lower() == self.val_attr:
                refresh = meta_tag.attrs['content']
                try:
                    pause, newurl = self.parse_refresh_header(refresh)
                    if newurl:
                        extracted['urls'] = [newurl]
                        break # one is enough
                except:
                    pass # nevermind
        return extracted
190518
function (incremental) {
        if (!reportHolder || !results) {
            return; // logging was not enabled
        }

        var table = '<table><thead><tr><th>Selector</th><th> </th><th>ms</th><th>Total</th></tr></thead><tbody>';

        // Extract the 10 slowest results
        var resultsArray = [];
        for (var res in results) {
            if (results.hasOwnProperty(res) && res !== "__baseline__") {
                resultsArray.push(results[res]);
            }
        }
        var sorted = resultsArray.sort(function (a, b) {
            if (a.baseline === b.baseline) {
                return 0;
            }

            if (incremental) {
                return a.baseline > b.baseline ? 1 : -1;
            } else {
                return a.baseline > b.baseline ? -1 : 1;
            }
        }).slice(0, 20);

        for (var i = 0, len = sorted.length; i < len; i += 1) {
            var item = sorted[i];
            table += '<tr><td style="font:11px monospace">Removing <strong>'
                    + item.name
                    + '</strong></td><td style="text-align:right">'
                    + (item.baseline > 0
                            ? '<span style="color:green">saves</span>'
                            : '<span style="color:red">adds</span>')
                    + '</td><td style="text-align:right; font:11px monospace">' + Math.abs(item.baseline) + 'ms</td>'
                    + '<td style="text-align:right; font:11px monospace">' + item.runTime + 'ms</td></tr>\n';
        }

        table += '</tbody></table><hr/>';

        // Summary
        table += '<table><tr><td style="text-align:right; font:10px monospace">Selectors Tested:</td><td style="font:10px monospace">'
                + resultsArray.length
                + '</td></tr>'
                + '<tr><td style="text-align:right; font:10px monospace">Baseline Time:</td><td style="font:10px monospace">'
                + results["__baseline__"].runTime + 'ms</td></tr>';

        style(reportHolder, {
            width : 600
        });

        logHolder.innerHTML = table;
    }
464692
function htmlReporter(reports, options = {}) {
  var {hide} = options;
  hide = hide || {};

  function htmlReporterOne({children, desc, status, counts, time, code}) {
    var text = T(desc);
    var attrs = {class: {[status]: true}};
    if (children) {
      return E('details') .
        has([
          E('summary') . has([text, !hide.counts && T(` (${makeCounts(counts)})`)]) . is(attrs),
          E('div') . has(htmlReporter(children, options))
        ]) .
        is(hide.children ? {} : {open: true});
    } else {
      return E('div') . has(text) . is(attrs);
    }
  }

  return M(reports, htmlReporterOne);
}
280651
public function htmlReport($data=[])
    {
        // Forcefully remove headers that might have been set by some
        // templates, controllers or plugins when rendering pages.
        header_remove();
        $root = dirname(__DIR__);
        $data['styles'] = file_get_contents($root . '/assets/report.css');
        $data['script'] = file_get_contents($root . '/assets/report.js');
        $body = Tpl::load(__DIR__ . '/report.php', $data);
        return new Response($body, 'html', $data['error'] ? 500 : 200);
    }
1054023
def open_current_in_browser(self):
        """"""
        if self.impact_path is None:
            html = self.page().mainFrame().toHtml()
            html_to_file(html, open_browser=True)
        else:
            if self.action_show_report.isEnabled():
                # if show report is enable, we are looking at a log
                open_in_browser(self.log_path)
            else:
                open_in_browser(self.report_path)
650466
def get(self, table_name):
        """"""
        assert table_name in self.tabs, \
            "Table not avaiable. Avaiable tables: {}".format(
                ", ".join(self.tabs.keys())
            )
        return self.tabs[table_name]
258959
function generateReport(html) {
        var template = grunt.file.read(templates.reportTemplate);
        return grunt.template.process(template, {
            data: {
                scenarios: html
            }
        });
    }
864276
def __get_html(self, body=None):
        

        output = []
        output.append("<html>")
        output.append("<head>")
        for javascript in (self.__jquery_javascript,
                           self.__crittercism_javascript,
                           self.__reporter_javascript):
            output.append("<script type=\"text/javascript\">")
            output.append(javascript)
            output.append("</script>")
        output.append("<style type=\"text/css\">")
        output.append(self.__style)
        output.append("</style>")
        output.append("</head>")
        if body is not None:
            output.append(body)
        else:
            output.append("<body>")
            output.append("<div id=\"report\">")
            output.append("</div>")
            output.append("</body>")
        output.append("</html>")
        return "\n".join(output)
924845
def get_html_column(self):
        

        panel_id = "panel_{}".format(self.name)
        return ["<h2>{}</h2>".format(self.title) + '<a href="{}">Download data</a>'.format(self.tar_fn())] + [
            # list of links
            (" <br />" + os.linesep).join(
                [
                    """
						   <strong>{bam_name}:</strong>
						   <a onclick="document.getElementById('{panel_id}').src='{bam_svg}';document.getElementById('{panel_id}_').href='{bam_html}';return false;" href="#">display graph</a>,
						   <a href="{bam_html}">detailed report</a>
						   """.format(
                        bam_name=bam.get_name(),
                        bam_html=bam.html_fn(),
                        bam_svg=bam.svg_fn(),
                        panel_id=panel_id,
                    ) for bam in self.bams
                ]
            ) + '<br /> '.format(self.tar_fn()),

            # main graph
            """
				   <div class="formats">
				   <a href="{html}" id="{panel_id}_">
				   <img src="{svg}" id="{panel_id}" />
				   </a>
				   </div>
				   """.format(
                html=self.bams[0]._html_fn,
                svg=self.bams[0]._svg_fn,
                panel_id=panel_id,
            ),
        ] + [
            # overall graphs
            """
				   <div class="formats">
				   <img src="{svg}" />
				   <br />
				   <a href="{svg}">SVG version</a>
				   |
				   <a href="{gp}" type="text/plain">GP file</a>
				   </div>
				   
				   """.format(
                svg=svg,
                gp=self._gp_fn,
            ) for svg in self._svg_fns
        ]
21249
def _analysis_data(self, analysis):
        
        decimalmark = analysis.aq_parent.aq_parent.getDecimalMark()
        keyword = analysis.getKeyword()
        andict = {
            'obj': analysis,
            'id': analysis.id,
            'title': analysis.Title(),
            'keyword': keyword,
            'scientific_name': analysis.getScientificName(),
            'accredited': analysis.getAccredited(),
            'point_of_capture': to_utf8(POINTS_OF_CAPTURE.getValue(analysis.getPointOfCapture())),
            'category': to_utf8(analysis.getCategoryTitle()),
            'result': analysis.getResult(),
            'unit': to_utf8(analysis.getUnit()),
            'formatted_unit': format_supsub(to_utf8(analysis.getUnit())),
            'capture_date': analysis.getResultCaptureDate(),
            'request_id': analysis.aq_parent.getId(),
            'formatted_result': '',
            'uncertainty': analysis.getUncertainty(),
            'formatted_uncertainty': '',
            'retested': analysis.isRetest(),
            'remarks': to_utf8(analysis.getRemarks()),
            'outofrange': False,
            'type': analysis.portal_type,
            'reftype': analysis.getReferenceType() if hasattr(
                analysis, 'getReferenceType') else None,
            'worksheet': None,
            'specs': {},
            'formatted_specs': '',
            'review_state': api.get_workflow_status_of(analysis),
        }

        andict['refsample'] = analysis.getSample().id \
            if IReferenceAnalysis.providedBy(analysis) \
            else analysis.getRequestID()

        specs = analysis.getResultsRange()
        andict['specs'] = specs
        scinot = self.context.bika_setup.getScientificNotationReport()
        andict['formatted_result'] = analysis.getFormattedResult(specs=specs, sciformat=int(scinot), decimalmark=decimalmark)

        fs = ''
        if specs.get('min', None) and specs.get('max', None):
            fs = '%s - %s' % (specs['min'], specs['max'])
        elif specs.get('min', None):
            fs = '> %s' % specs['min']
        elif specs.get('max', None):
            fs = '< %s' % specs['max']
        andict['formatted_specs'] = formatDecimalMark(fs, decimalmark)
        andict['formatted_uncertainty'] = format_uncertainty(analysis, analysis.getResult(), decimalmark=decimalmark, sciformat=int(scinot))

        # Out of range?
        andict['outofrange'] = is_out_of_range(analysis)[0]
        return andict
740789
def get_report(self, report_type, qs=None):
        """"""
        if qs is None:
            qs = {}

        url = self.api_url + "/company/{0}/reports/{1}".format(self.company_id, report_type)
        result = self.get(url, params=qs)
        return result
170556
def report(output)
      output.title(options[:title]) if options[:title]

      if @last > 0 && @first < 99_999_999_999_999
        output.with_style(cell_separator: false) do
          output.table({ width: 20 }, {}) do |rows|
            rows << ['First request:', first_timestamp.strftime('%Y-%m-%d %H:%M:%I')]
            rows << ['Last request:',  last_timestamp.strftime('%Y-%m-%d %H:%M:%I')]
            rows << ['Total time analyzed:', "#{timespan.ceil} days"]
          end
        end
      end
    end
880942
def _get_pretty_table(self, fields):
        """"""
        pt = prettytable.PrettyTable(fields)
        pt.align = 'l'
        pt.border = False
        pt.header_style = "upper"
        return pt
33569
def _get_html_contents(html):
    """"""
    parser = MyHTMLParser()
    parser.feed(html)
    if parser.is_code:
        return ('code', parser.data.strip())
    elif parser.is_math:
        return ('math', parser.data.strip())
    else:
        return '', ''
1255452
function getTableDetails(table) {
        return Tools.map(table.rows, function (row) {

          var cells = Tools.map(row.cells, function (cell) {

            var rowspan = cell.hasAttribute('rowspan') ? parseInt(cell.getAttribute('rowspan'), 10) : 1;
            var colspan = cell.hasAttribute('colspan') ? parseInt(cell.getAttribute('colspan'), 10) : 1;

            return {
              element: cell,
              rowspan: rowspan,
              colspan: colspan
            };
          });

          return {
            element: row,
            cells: cells
          };

        });

      }