Args:
            reports: list[str] - output from the report
        Return:
            A dict[Str:Violation]
            Violation is a simple named tuple Defined above
776113
def parse_reports(self, reports):
        
        violations_dict = defaultdict(list)
        for report in reports:
            output_lines = report.split('\n')

            for output_line_number, line in enumerate(output_lines):
                match = self.pylint_expression.match(line)

                # Ignore any line that isn't matched
                # (for example, snippets from the source code)
                if match is not None:

                    (pylint_src_path,
                     line_number,
                     pylint_code,
                     function_name,
                     message) = match.groups()
                    if pylint_code == self.dupe_code_violation:
                        files_involved = self._process_dupe_code_violation(
                            output_lines,
                            output_line_number,
                            message
                        )
                    else:
                        files_involved = [(pylint_src_path, line_number)]

                    for violation in files_involved:
                        pylint_src_path, line_number = violation
                        # If we're looking for a particular source file,
                        # ignore any other source files.
                        if function_name:
                            error_str = "{}: {}: {}".format(pylint_code, function_name, message)
                        else:
                            error_str = "{}: {}".format(pylint_code, message)

                        violation = Violation(int(line_number), error_str)
                        violations_dict[pylint_src_path].append(violation)

        return violations_dict
900069
def paramsReport(self):
        """"""
        report = {}
        for param in self._REPORTPARAMS:
            pvalue = getattr(self, param)
            if isinstance(pvalue, float):
                report[param] = pvalue
            elif isinstance(pvalue, scipy.ndarray) and pvalue.shape == (3, N_NT):
                for p in range(3):
                    for w in range(N_NT - 1):
                        report['{0}{1}{2}'.format(param, p, INDEX_TO_NT[w])] =\
                                pvalue[p][w]
            else:
                raise ValueError("Unexpected param: {0}".format(param))
        return report
673630
def get_reports(self, report_ids):
        '''
        
        '''
        res = {}
        for rid in report_ids:
            print('Fetching report %d' % rid)
            resp = requests.get('%s/api/report?report_id=%d' % (self.url, rid))
            if resp.status_code != 200:
                print('[!] failed to fetch report %d' % rid)
            else:
                res[rid] = resp.text
        return res
946139
def report_error(self, read_tuple_name, error_name, wrong="", message="", warning=False):
        
        if (not self.report_only_first) or (error_name not in self.reported_errors):
            print("\t".join(["error" if warning == False else "warning", read_tuple_name, error_name, wrong, message]))
        self.reported_errors.add(error_name)
        if warning:
            self.warning_has_been_reported = True
        else:
            self.error_has_been_reported = True
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)
766719
def on_exception_report_input(func_=None, force=False, keys=None):
    
    def _closure_onexceptreport(func):
        if not ONEX_REPORT_INPUT and not force:
            return func
        @ignores_exc_tb(outer_wrapper=False)
        #@wraps(func)
        def wrp_onexceptreport(*args, **kwargs):
            try:
                #import utool
                #if utool.DEBUG:
                #    print('[IN EXCPRPT] args=%r' % (args,))
                #    print('[IN EXCPRPT] kwargs=%r' % (kwargs,))
                return func(*args, **kwargs)
            except Exception as ex:
                from utool import util_str
                print('ERROR occured! Reporting input to function')
                if keys is not None:
                    from utool import util_inspect
                    from utool import util_list
                    from utool import util_dict
                    argspec = util_inspect.get_func_argspec(func)
                    in_kwargs_flags = [key in kwargs for key in keys]
                    kwarg_keys = util_list.compress(keys, in_kwargs_flags)
                    kwarg_vals = [kwargs.get(key) for key in kwarg_keys]
                    flags = util_list.not_list(in_kwargs_flags)
                    arg_keys = util_list.compress(keys, flags)
                    arg_idxs = [argspec.args.index(key) for key in arg_keys]
                    num_nodefault = len(argspec.args) - len(argspec.defaults)
                    default_vals = (([None] * (num_nodefault)) +
                                    list(argspec.defaults))
                    args_ = list(args) + default_vals[len(args) + 1:]
                    arg_vals = util_list.take(args_, arg_idxs)
                    requested_dict = dict(util_list.flatten(
                        [zip(kwarg_keys, kwarg_vals), zip(arg_keys, arg_vals)]))
                    print('input dict = ' + util_str.repr4(
                        util_dict.dict_subset(requested_dict, keys)))
                    # (print out specific keys only)
                    pass
                arg_strs = ', '.join([repr(util_str.truncate_str(str(arg)))
                                      for arg in args])
                kwarg_strs = ', '.join([
                    util_str.truncate_str('%s=%r' % (key, val))
                    for key, val in six.iteritems(kwargs)])
                msg = ('\nERROR: funcname=%r,\n * args=%s,\n * kwargs=%r\n' % (
                    meta_util_six.get_funcname(func), arg_strs, kwarg_strs))
                msg += ' * len(args) = %r\n' % len(args)
                msg += ' * len(kwargs) = %r\n' % len(kwargs)
                util_dbg.printex(ex, msg, pad_stdout=True)
                raise
        wrp_onexceptreport = preserve_sig(wrp_onexceptreport, func)
        return wrp_onexceptreport
    if func_ is None:
        return _closure_onexceptreport
    else:
        return _closure_onexceptreport(func_)
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)
839922
private void printViolations(Violations violations, PrintWriter out) {
        out.println("Violations found:");
        if (violations.hasViolations()) {
            for (Violation violation : violations.asList()) {
                out.println(" - " + violation);
            }
        } else {
            out.println(" - No violations found.");
        }
    }
855287
def collect(since, to, top=DEFAULT_TOP):
    
    summary = CspReportSummary(since, to, top=top)
    queryset = CSPReport.objects.filter(created__range=(since, to))
    valid_queryset = queryset.filter(is_valid=True)
    invalid_queryset = queryset.filter(is_valid=False)

    summary.total_count = queryset.count()
    summary.valid_count = valid_queryset.count()

    # Collect sources
    sources = {}
    for report in valid_queryset:
        root_uri = get_root_uri(report.document_uri)
        info = sources.setdefault(root_uri, ViolationInfo(root_uri))
        info.append(report)
    summary.sources = sorted(sources.values(), key=attrgetter('count'), reverse=True)[:top]

    # Collect blocks
    blocks = {}
    for report in valid_queryset:
        root_uri = get_root_uri(report.blocked_uri)
        info = blocks.setdefault(root_uri, ViolationInfo(root_uri))
        info.append(report)
    summary.blocks = sorted(blocks.values(), key=attrgetter('count'), reverse=True)[:top]

    # Collect invalid reports
    summary.invalid_count = invalid_queryset.count()
    summary.invalid_reports = tuple(invalid_queryset[:top])

    return summary
147142
def get_report_data(self, report):
        
        ar = report.getAnalysisRequest()
        attachments = map(self.get_attachment_data, ar.getAttachment())
        pdf = self.get_pdf(report)
        filesize = "{} Kb".format(self.get_filesize(pdf))
        filename = "{}.pdf".format(ar.getId())

        return {
            "ar": ar,
            "attachments": attachments,
            "pdf": pdf,
            "obj": report,
            "uid": api.get_uid(report),
            "filesize": filesize,
            "filename": filename,
        }
891039
def dump_report_content(self, request, result):
        

        output = StringIO()
        writer = csv.writer(output, **self.csv_kwargs)
        writer.writerows([result.headers] + result.values)
        return output.getvalue()
606308
def get_recipients_data(self, reports):
        
        if not reports:
            return []

        recipients = []
        recipient_names = []

        for num, report in enumerate(reports):
            # get the linked AR of this ARReport
            ar = report.getAnalysisRequest()
            # recipient names of this report
            report_recipient_names = []
            for recipient in self.get_recipients(ar):
                name = recipient.get("Fullname")
                email = recipient.get("EmailAddress")
                record = {
                    "name": name,
                    "email": email,
                    "valid": True,
                }
                if record not in recipients:
                    recipients.append(record)
                # remember the name of the recipient for this report
                report_recipient_names.append(name)
            recipient_names.append(report_recipient_names)

        # recipient names, which all of the reports have in common
        common_names = set(recipient_names[0]).intersection(*recipient_names)
        # mark recipients not in common
        for recipient in recipients:
            if recipient.get("name") not in common_names:
                recipient["valid"] = False
        return recipients
896876
def cli(ctx, report, semantic, rcfile):
    
    ctx.obj = {
        'report': report,
        'semantic': semantic,
        'rcfile': rcfile,
    }
751187
function reportIsValid(report = {}) {
	return report.valid && report.errors.length === 0 && report.warnings.length === 0;
}
1056110
def dump(self):
        
        report_as_json_string = utils.dict_to_json(self.report)
        if self.out_file:
            utils.string_to_file(self.out_file, report_as_json_string)
        else:
            print report_as_json_string
665170
def report(self, stream):
        
        from collections import OrderedDict
        self.stats['total'] = sum(self.stats.values())
        for group in self.report_data.values():
            group.stats['total'] = sum(group.stats.values())
        self.report_file.write(self.jinja.get_template('report.html').render(
            report=OrderedDict(sorted(self.report_data.items())),
            stats=self.stats,
        ))
        self.report_file.close()
        if self.config.verbosity > 1:
            stream.writeln("-" * 70)
            stream.writeln("HTML: %s" % self.report_file.name)
138157
def paramsReport(self):
        """"""
        report = {}
        for param in self._REPORTPARAMS:
            pvalue = getattr(self, param)
            if isinstance(pvalue, float):
                report[param] = pvalue
            elif isinstance(pvalue, scipy.ndarray) and pvalue.shape == (N_NT,):
                for w in range(N_NT - 1):
                    report['{0}{1}'.format(param, INDEX_TO_NT[w])] = pvalue[w]
            elif isinstance(pvalue, scipy.ndarray) and (pvalue.shape ==
                    (self.nsites, N_AA)):
                for r in range(self.nsites):
                    for a in range(N_AA):
                        report['{0}{1}{2}'.format(param, r + 1, INDEX_TO_AA[a])
                                ] = pvalue[r][a]
            else:
                raise ValueError("Unexpected param: {0}".format(param))
        return report