Show the report for a single pants run.
1214
def _handle_run(self, relpath, params):
    """"""
    args = self._default_template_args('run.html')
    run_id = relpath
    run_info = self._get_run_info_dict(run_id)
    if run_info is None:
      args['no_such_run'] = relpath
      if run_id == 'latest':
        args['is_latest'] = 'none'
    else:
      report_abspath = run_info['default_report']
      report_relpath = os.path.relpath(report_abspath, self._root)
      report_dir = os.path.dirname(report_relpath)
      self_timings_path = os.path.join(report_dir, 'self_timings')
      cumulative_timings_path = os.path.join(report_dir, 'cumulative_timings')
      artifact_cache_stats_path = os.path.join(report_dir, 'artifact_cache_stats')
      run_info['timestamp_text'] = \
        datetime.fromtimestamp(float(run_info['timestamp'])).strftime('%H:%M:%S on %A, %B %d %Y')

      timings_and_stats = '\n'.join([
        self._collapsible_fmt_string.format(id='cumulative-timings-collapsible',
                                            title='Cumulative timings', class_prefix='aggregated-timings'),
        self._collapsible_fmt_string.format(id='self-timings-collapsible',
                                            title='Self timings', class_prefix='aggregated-timings'),
        self._collapsible_fmt_string.format(id='artifact-cache-stats-collapsible',
                                            title='Artifact cache stats', class_prefix='artifact-cache-stats')
      ])

      args.update({'run_info': run_info,
                   'report_path': report_relpath,
                   'self_timings_path': self_timings_path,
                   'cumulative_timings_path': cumulative_timings_path,
                   'artifact_cache_stats_path': artifact_cache_stats_path,
                   'timings_and_stats': timings_and_stats})
      if run_id == 'latest':
        args['is_latest'] = run_info['id']

    content = self._renderer.render_name('base.html', args).encode("utf-8")
    self._send_content(content, 'text/html')
561354
def report(output)
      report_header(output)
      if source.parsed_requests > 0
        @trackers.each { |tracker| output.report_tracker(tracker) }
      else
        output.puts
        output.puts('There were no requests analyzed.')
      end
      report_footer(output)
    end
805115
def report(self):
        

        # We need only the first 4 significant digits
        tt = (str(self._endtime - self._starttime))[:4]

        self.log('\n%s finished in %s seconds.' % (__pkg_name__, tt))
        self.log('%d directories parsed, %d files copied' %
                 (self._numdirs, self._numfiles))
        if self._numdelfiles:
            self.log('%d files were purged.' % self._numdelfiles)
        if self._numdeldirs:
            self.log('%d directories were purged.' % self._numdeldirs)
        if self._numnewdirs:
            self.log('%d directories were created.' % self._numnewdirs)
        if self._numupdates:
            self.log('%d files were updated by timestamp.' % self._numupdates)

        # Failure stats
        self.log('')
        if self._numcopyfld:
            self.log('there were errors in copying %d files.'
                     % self._numcopyfld)
        if self._numdirsfld:
            self.log('there were errors in creating %d directories.'
                     % self._numdirsfld)
        if self._numupdsfld:
            self.log('there were errors in updating %d files.'
                     % self._numupdsfld)
        if self._numdeldfld:
            self.log('there were errors in purging %d directories.'
                     % self._numdeldfld)
        if self._numdelffld:
            self.log('there were errors in purging %d files.'
                     % self._numdelffld)
278122
function () {
    // index page
    this.events.on('report:assertion', this.outputAssertionResult.bind(this));
    this.events.on('report:test:finished', this.outputTestFinished.bind(this));
    this.events.on('report:runner:finished', this.outputRunnerFinished.bind(this));
    this.events.on('report:run:browser', this.outputRunBrowser.bind(this));

    // detail page
    this.events.on('report:test:started', this.startDetailPage.bind(this));
    this.events.on('report:action', this.addActionToDetailPage.bind(this));
    this.events.on('report:assertion', this.addAssertionToDetailPage.bind(this));
    this.events.on('report:test:finished', this.finishDetailPage.bind(this));

    return this;
  }
1341982
def report(self, simulation, state):
        
        if not self._initialized:
            self._initial_clock_time = datetime.now()
            self._initial_simulation_time = state.getTime()
            self._initial_steps = simulation.currentStep
            self._initialized = True

        steps = simulation.currentStep
        time = datetime.now() - self._initial_clock_time
        days = time.total_seconds()/86400.0
        ns = (state.getTime()-self._initial_simulation_time).value_in_unit(u.nanosecond)

        margin = ' ' * self.margin
        ns_day = ns/days
        delta = ((self.total_steps-steps)*time.total_seconds())/steps
        # remove microseconds to have cleaner output
        remaining = timedelta(seconds=int(delta))
        percentage = 100.0*steps/self.total_steps
        if ns_day:
            template = '{}{}/{} steps ({:.1f}%) - {} left @ {:.1f} ns/day                    \r'
        else:
            template = '{}{}/{} steps ({:.1f}%)                                              \r'
        report = template.format(margin, steps, self.total_steps, percentage, remaining, ns_day)
        self._out.write(report)
        if hasattr(self._out, 'flush'):
            self._out.flush()
888456
function report() {
      return Object.keys(eventsByFilename)
        .filter(testIncluded)
        .reduce(reduceFilenames, {});

      function testIncluded(filename) {
        return !excludeRegex || !excludeRegex.test(filename);
      }

      function reduceFilenames(reduced, filename) {
        var totalsByKey = {},
            list        = eventsByFilename[filename],
            lastKey     = null,
            lastTime    = NaN;

        // events consist of time,key pairs
        for (var i = 0; i < list.length; i += 2) {
          var time = list[i],
              key  = list[i + 1];
          if (lastKey) {
            var initial = totalsByKey[key] || 0,
                delta   = ((time - lastTime) / 1000) || 0;
            totalsByKey[lastKey] = initial + delta;
          }
          lastKey = key;
          lastTime = time;
        }

        // total at the end to guarantee consistency
        var total = 0;
        for (var key in totalsByKey) {
          total += totalsByKey[key];
        }
        totalsByKey.total = total;

        // store by the short filename
        var short = path.relative(process.cwd(), filename);
        reduced[short] = totalsByKey;
        return reduced;
      }
    }
1337063
private void report(I_CmsReport report, int counter, int resCount, CmsResource resource) {

        // report entries
        report.print(
            org.opencms.report.Messages.get().container(
                org.opencms.report.Messages.RPT_SUCCESSION_2,
                String.valueOf(counter),
                String.valueOf(resCount)),
            I_CmsReport.FORMAT_NOTE);
        report.print(
            org.opencms.report.Messages.get().container(
                org.opencms.report.Messages.RPT_ARGUMENT_1,
                report.removeSiteRoot(resource.getRootPath())));
        report.print(
            org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0),
            I_CmsReport.FORMAT_DEFAULT);
    }
1314960
def report(self, stream):
        """"""
        self.db.commit()

        stream.writeln()
        self.draw_header(stream, "10 SLOWEST SETUPS")
        self.display_slowest_setups(stream)

        stream.writeln()
        self.draw_header(stream, "10 SLOWEST TESTS")
        self.display_slowest_tests(stream)
        stream.writeln()

        if self.html_output_file:
            HtmlReport.write(self.html_output_file)
885312
def run(self, **kwargs):
        '''
        
        '''
        self.report_start()
        for bench in self.benchmarks:
            bench = bench(before=self.report_before_method,
                      after=self.report_after_method,
                      after_each=self.report_progress,
                      debug=self.debug,
                      **kwargs)
            self.report_before_class(bench)
            bench.run()
            self.report_after_class(bench)
            self.runned.append(bench)
        self.report_end()
572584
protected void displayResult() {

        if (m_thread.getMatchedResources().isEmpty()) {
            m_resultTable.setVisible(false);
            m_infoIntroLayout.setVisible(false);
            m_infoEmptyResult.setVisible(true);
        } else {
            m_resultTable.setVisible(true);
            m_infoIntroLayout.setVisible(false);
            m_infoEmptyResult.setVisible(false);
        }
        m_resultTable.fillTable(A_CmsUI.getCmsObject(), m_thread.getMatchedResources());
        m_searchForm.removeComponent(m_report);
        m_report = null;
    }
230217
def _generate_report(ret, setup):
    '''
    
    '''

    retdata = ret.get('return', {})

    sorted_data = sorted(
        retdata.items(),
        key=lambda s: s[1].get('__run_num__', 0)
    )

    total = 0
    failed = 0
    changed = 0
    duration = 0.0

    # gather stats
    for _, data in sorted_data:
        if not data.get('result', True):
            failed += 1
        total += 1

        try:
            duration += float(data.get('duration', 0.0))
        except ValueError:
            pass

        if data.get('changes', {}):
            changed += 1

    unchanged = total - failed - changed

    log.debug('highstate total: %s', total)
    log.debug('highstate failed: %s', failed)
    log.debug('highstate unchanged: %s', unchanged)
    log.debug('highstate changed: %s', changed)

    # generate report if required
    if setup.get('report_everything', False) or \
       (setup.get('report_changes', True) and changed != 0) or \
       (setup.get('report_failures', True) and failed != 0):

        report = [
            {'stats': [
                {'total': total},
                {'failed': failed, '__style__': 'failed'},
                {'unchanged': unchanged, '__style__': 'unchanged'},
                {'changed': changed, '__style__': 'changed'},
                {'duration': duration}
            ]},
            {'job': [
                {'function': ret.get('fun', '')},
                {'arguments': ret.get('fun_args', '')},
                {'jid': ret.get('jid', '')},
                {'success': ret.get('success', True)},
                {'retcode': ret.get('retcode', 0)}
            ]},
            {'states': _generate_states_report(sorted_data)}
        ]

        if failed:
            function = setup.get('failure_function', None)
        else:
            function = setup.get('success_function', None)

        if function:
            func_result = __salt__[function]()
            report.insert(
                0,
                {'extra': [{function: _dict_to_name_value(func_result)}]}
            )

    else:
        report = []

    return report, failed
633577
def report_issue(self, body=None, title=None, open_webpage=False):
        """"""
        if body is None:
            from spyder.widgets.reporterror import SpyderErrorDialog
            report_dlg = SpyderErrorDialog(self, is_report=True)
            report_dlg.show()
        else:
            if open_webpage:
                if PY3:
                    from urllib.parse import quote
                else:
                    from urllib import quote     # analysis:ignore
                from qtpy.QtCore import QUrlQuery

                url = QUrl(__project_url__ + '/issues/new')
                query = QUrlQuery()
                query.addQueryItem("body", quote(body))
                if title:
                    query.addQueryItem("title", quote(title))
                url.setQuery(query)
                QDesktopServices.openUrl(url)
1165872
def quick_report(report_type, change, options):
    

    report = report_type(None, options)

    if options.output:
        with open(options.output, "w") as out:
            report.run(change, None, out)
    else:
        report.run(change, None, sys.stdout)
1003575
def run_single_with_display(wf, display):
    """"""
    S = Scheduler(error_handler=display.error_handler)
    W = Queue() \
        >> branch(log_job_start.to(sink_map(display))) \
        >> worker \
        >> branch(sink_map(display))

    return S.run(W, get_workflow(wf))
102295
private void run(ReportOperation operation) throws ReportException {
        Set<String> executedPlugins = new HashSet<>();
        run(selectedReportPlugins, operation, executedPlugins);
        run(defaultReportPlugins, operation, executedPlugins);
    }
779029
def on_close(self, stats, previous_stats):
        
        reports = {
            'messages': self._messages,
            'stats': stats,
            'previous': previous_stats,
        }
        print(json.dumps(reports, cls=JSONSetEncoder, indent=4), file=self.out)
1223608
def report(self):
        
        aggregations = dict(
            (test, Counter().rollup(values))
            for test, values in self.socket_warnings.items()
        )
        total = sum(
            len(warnings)
            for warnings in self.socket_warnings.values()
        )

        def format_test_statistics(test, counter):
            return "%s:\n%s" % (
                test,
                '\n'.join(
                    '  - %s: %s' % (socket, count)
                    for socket, count in counter.items()
                )
            )

        def format_statistics(aggregations):
            return '\n'.join(
                format_test_statistics(test, counter)
                for test, counter in aggregations.items()
            )

        # Only print the report if there are actually things to report.
        if aggregations:
            print('=' * 70, file=self.stream)
            print(
                'NON-WHITELISTED SOCKETS OPENED: %s' % total,
                file=self.stream,
            )
            print('-' * 70, file=self.stream)
            print(format_statistics(aggregations), file=self.stream)