Installs the exceptions reporter.

    :param report: Report to Crittercism.
    :type report: bool
    :return: Reporter instance.
    :rtype: Reporter
186497
def install_exception_reporter(report=True):
    

    reporter = Reporter(report=report)
    sys.excepthook = reporter
    return reporter
49285
def update(self, report: str = None) -> bool:
        
        if report is not None:
            self.raw = report
        else:
            raw = self.service.fetch(self.station)
            if raw == self.raw:
                return False
            self.raw = raw
        self.data, self.units = metar.parse(self.station, self.raw)
        self.translations = translate.metar(self.data, self.units)  # type: ignore
        self.last_updated = datetime.utcnow()
        return True
291637
def report(title='Unhandled Exception', exec_info=(), **kwargs):
    

    exc_type, exc_value, tb = exec_info or sys.exc_info()
    reporter = ExceptionReporter(exc_type, exc_value, tb)
    html = reporter.get_traceback_html(**kwargs)

    mail_admins(title, 'html only', html_message=html)
1307374
def get_report(self, linewise=False, no_lines=False):
		
		if linewise:
			return self._get_linewise_report()
		else:
			return self._get_report(not no_lines)
4869
def process_failure(project):
    
    if failure:
        lists = get_lists.GetLists()
        report_url = lists.report_url(project)
        if report_url:
            print(report_url)
        sys.exit(1)
1003759
def reporter_class
      rpt_format = format || :pretty
      class_name = rpt_format.to_s.capitalize + "Reporter"

      path = "turn/reporters/#{rpt_format}_reporter"

      [File.expand_path('~'), Dir.pwd].each do |dir|
        file = File.join(dir, ".turn", "reporters", "#{rpt_format}_reporter.rb")
        path = file if File.exist?(file)
      end

      require path

      Turn.const_get(class_name)
    end
645754
def report_exception(self, filename, exc):
        
        # Build fake event.
        event = AbinitError(src_file="Unknown", src_line=0, message=str(exc))
        return EventReport(filename, events=[event])
1353310
def build_report(self, op_file, tpe='md'):
        
        if tpe == 'md':
            res = self.get_report_md()
        elif tpe == 'rst':
            res = self.get_report_rst()
        elif tpe == 'html':
            res = self.get_report_html()
        else:
            res = 'Unknown report type passed to project.build_report'
        
        with open(op_file, 'w') as f:
            f.write(res)
1008544
public final void start() {
    if (this.started) {
      log.warn(String.format("Reporter %s has already been started.", this.name));
      return;
    }
    try {
      startImpl();
      this.started = true;
    } catch (Exception exception) {
      log.warn(String.format("Reporter %s did not start correctly.", this.name), exception);
    }
  }
946642
def set_exception(self, exception):
        
        assert isinstance(exception, Exception), \
            "%r should be an Exception" % exception
        self._exception = exception
        self._state = self.FINISHED
7767
def update_reporting(self, global_options, is_quiet, run_tracker):
    """"""

    # Get any output silently buffered in the old console reporter, and remove it.
    removed_reporter = run_tracker.report.remove_reporter('capturing')
    buffered_out = self._consume_stringio(removed_reporter.settings.outfile)
    buffered_err = self._consume_stringio(removed_reporter.settings.errfile)

    log_level = Report.log_level_from_string(global_options.level or 'info')
    # Ideally, we'd use terminfo or somesuch to discover whether a
    # terminal truly supports color, but most that don't set TERM=dumb.
    color = global_options.colors and (os.getenv('TERM') != 'dumb')
    timing = global_options.time
    cache_stats = global_options.time  # TODO: Separate flag for this?

    if is_quiet:
      console_reporter = QuietReporter(run_tracker,
                                       QuietReporter.Settings(log_level=log_level, color=color,
                                                              timing=timing, cache_stats=cache_stats))
    else:
      # Set up the new console reporter.
      stdout = sys.stdout.buffer if PY3 else sys.stdout
      stderr = sys.stderr.buffer if PY3 else sys.stderr
      settings = PlainTextReporter.Settings(log_level=log_level, outfile=stdout, errfile=stderr,
                                            color=color, indent=True, timing=timing, cache_stats=cache_stats,
                                            label_format=self.get_options().console_label_format,
                                            tool_output_format=self.get_options().console_tool_output_format)
      console_reporter = PlainTextReporter(run_tracker, settings)
      console_reporter.emit(buffered_out, dest=ReporterDestination.OUT)
      console_reporter.emit(buffered_err, dest=ReporterDestination.ERR)
      console_reporter.flush()
    run_tracker.report.add_reporter('console', console_reporter)

    if global_options.logdir:
      # Also write plaintext logs to a file. This is completely separate from the html reports.
      safe_mkdir(global_options.logdir)
      run_id = run_tracker.run_info.get_info('id')
      outfile = open(os.path.join(global_options.logdir, '{}.log'.format(run_id)), 'wb')
      errfile = open(os.path.join(global_options.logdir, '{}.err.log'.format(run_id)), 'wb')
      settings = PlainTextReporter.Settings(log_level=log_level, outfile=outfile, errfile=errfile,
                                            color=False, indent=True, timing=True, cache_stats=True,
                                            label_format=self.get_options().console_label_format,
                                            tool_output_format=self.get_options().console_tool_output_format)
      logfile_reporter = PlainTextReporter(run_tracker, settings)
      logfile_reporter.emit(buffered_out, dest=ReporterDestination.OUT)
      logfile_reporter.emit(buffered_err, dest=ReporterDestination.ERR)
      logfile_reporter.flush()
      run_tracker.report.add_reporter('logfile', logfile_reporter)

    invalidation_report = self._get_invalidation_report()
    if invalidation_report:
      run_id = run_tracker.run_info.get_info('id')
      outfile = os.path.join(self.get_options().reports_dir, run_id, 'invalidation-report.csv')
      invalidation_report.set_filename(outfile)

    return invalidation_report
564963
def load_report(identifier=None):
    '''
    
    '''
    path = os.path.join(
        report_dir(),
        identifier + '.pyireport'
    )
    return ProfilerSession.load(path)
392264
def reporter(self):
        
        logging.info('Creating {} report'.format(self.analysistype))
        # Create the path in which the reports are stored
        make_path(self.reportpath)
        header = 'Strain,Serotype\n'
        data = ''
        with open(os.path.join(self.reportpath, '{}.csv'.format(self.analysistype)), 'w') as report:
            for sample in self.runmetadata.samples:
                if sample.general.bestassemblyfile != 'NA':
                    data += sample.name + ','
                    if sample[self.analysistype].results:
                        # Set the O-type as either the appropriate attribute, or O-untypable
                        if ';'.join(sample.serosippr.o_set) == '-':
                            otype = 'O-untypeable'
                        else:
                            otype = '{oset} ({opid})'.format(oset=';'.join(sample.serosippr.o_set),
                                                             opid=sample.serosippr.best_o_pid)
                        # Same as above, but for the H-type
                        if ';'.join(sample.serosippr.h_set) == '-':
                            htype = 'H-untypeable'

                        else:
                            htype = '{hset} ({hpid})'.format(hset=';'.join(sample.serosippr.h_set),
                                                             hpid=sample.serosippr.best_h_pid)
                        serotype = '{otype}:{htype}'.format(otype=otype,
                                                            htype=htype)
                        # Populate the data string
                        data += serotype if serotype != 'O-untypeable:H-untypeable' else 'ND'
                        data += '\n'
                    else:
                        data += '\n'
            report.write(header)
            report.write(data)
1036526
def reporter(self):
        
        logging.info('Creating {} report'.format(self.analysistype))
        make_path(self.reportpath)
        header = 'Strain,ReferenceGenus,ReferenceFile,ReferenceGenomeMashDistance,Pvalue,NumMatchingHashes\n'
        data = ''
        for sample in self.metadata:
            try:
                data += '{},{},{},{},{},{}\n'.format(sample.name,
                                                     sample[self.analysistype].closestrefseqgenus,
                                                     sample[self.analysistype].closestrefseq,
                                                     sample[self.analysistype].mashdistance,
                                                     sample[self.analysistype].pvalue,
                                                     sample[self.analysistype].nummatches)
            except AttributeError:
                data += '{}\n'.format(sample.name)
        # Create the report file
        reportfile = os.path.join(self.reportpath, 'mash.csv')
        with open(reportfile, 'w') as report:
            report.write(header)
            report.write(data)
451328
def patch_statusreporter():
    
    from robot.running.statusreporter import StatusReporter

    orig_exit = StatusReporter.__exit__

    def __exit__(self, exc_type, exc_val, exc_tb):
        if exc_val and isinstance(exc_val, Exception):
            set_pdb_trace(pm=True)
        return orig_exit(self, exc_type, exc_val, exc_tb)

    StatusReporter.__exit__ = __exit__
1259741
def create_report(self):
        

        if self.report:
            self.report += "\n Operation took %s secs" % round(
                time.time() - self.t1)
        else:
            self.report = "Operation failed: %s \n" % self.report
        return self.report
869399
def parse_reports(self):
    

    # Get data
    data = _parse_reports_by_type(self)

    if data:
        #  Filter to strip out ignored sample names (REQUIRED)
        data = self.ignore_samples(data)

        # Populate the general stats table
        _add_data_to_general_stats(self, data)

        # Add any found data to the report
        _add_section_to_report(self, data)

        # Write parsed data to a file
        self.write_data_file(data, 'multiqc_picard_validatesamfile')

    self.picard_ValidateSamFile_data = data  # Seems like the right thing to do
    return len(data)