Print GOEA results with some additional statistics calculated.
517094
def print_results(self, results, min_ratio=None, indent=False, pval=0.05, prt=sys.stdout):
        """"""
        results_adj = self.get_adj_records(results, min_ratio, pval)
        self.print_results_adj(results_adj, indent, prt)
864049
def get_study_items(self):
        """"""
        study_items = set()
        for rec in self.goea_results:
            study_items |= rec.study_items
        return study_items
816915
def run_study_nts(self, study, **kws):
        """"""
        goea_results = self.run_study(study, **kws)
        return MgrNtGOEAs(goea_results).get_goea_nts_all()
568993
def print_results(self):
        """"""
        # Updates
        if self.package_data.get('updates'):
            print('\n{}{}Updates:'.format(c.Style.BRIGHT, c.Fore.BLUE))
            for p in self.package_data['updates']:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # Packaging
        print('\n{}{}Package:'.format(c.Style.BRIGHT, c.Fore.BLUE))
        for p in self.package_data['package']:
            if isinstance(p.get('output'), list):
                n = 5
                list_data = p.get('output')
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, ', '.join(p.get('output')[:n])
                    )
                )
                del list_data[:n]
                for data in [
                    list_data[i : i + n] for i in range(0, len(list_data), n)  # noqa: E203
                ]:
                    print(
                        '{!s:<20}{}{} {!s:<50}'.format(
                            '', c.Style.BRIGHT, c.Fore.CYAN, ', '.join(data)
                        )
                    )

            else:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # Bundle
        if self.package_data.get('bundle'):
            print('\n{}{}Bundle:'.format(c.Style.BRIGHT, c.Fore.BLUE))
            for p in self.package_data['bundle']:
                print(
                    '{!s:<20}{}{} {!s:<50}'.format(
                        p.get('action'), c.Style.BRIGHT, c.Fore.CYAN, p.get('output')
                    )
                )

        # ignore exit code
        if not self.args.ignore_validation:
            print('\n')  # separate errors from normal output
            # print all errors
            for error in self.package_data.get('errors'):
                print('{}{}'.format(c.Fore.RED, error))
                self.exit_code = 1
879252
def print_statistics(self):
        
        print("Q1 =", self.Q1)
        print("Q2 =", self.Q2)
        print("cR =", self.cR)
400745
def display_results(results, detailed=False):
    
    # print("\nVALIDATOR RESULTS")
    # print("======================\n")

    if not detailed:
        print('FILENAME......................................... STATUS..........')

    for entry in results:
        try:
            if detailed:
                print("\n{}".format(entry["filename"]))
                print(create_detailed_results(entry))
            else:
                print("{:<50}{}".format(entry["filename"], entry["status"]))
        except Exception as e:
            logger_validator_api.debug("display_results: Exception: {}".format(e))
            print("Error: display_results: {}".format(e))

    return
221058
def prt_summary(self, prt=sys.stdout):
        """"""
        desc = "NtGoeaResults" if self.is_goterm else "namedtuple"
        prt.write("{N} GOEA results from {O}. P-values stored in {P}.\n".format(
            N=len(self.go2res), O=desc, P=self.pval_name))
1141221
def check_results(tmp_):
        """"""
        # TODO: Fix this to work with more meaningful names
        if tmp_['t'] > 0:
            if tmp_['l'] > 0:
                if tmp_['rr'] > 0 or tmp_['ra'] > 1:
                    print 1, 3, tmp_
                    return 3
                elif tmp_['cr'] > 0 or tmp_['ca'] > 1:
                    print 2, 3, tmp_
                    return 3
                elif tmp_['mr'] > 0 or tmp_['ma'] > 1:
                    print 3, 2, tmp_
                    return 2
            if tmp_['cr'] > 1 or tmp_['ca'] > 2:
                print 4, 2, tmp_
                return 2
            if tmp_['mr'] > 0 or tmp_['ma'] > 1:
                if tmp_['cr'] > 0 or tmp_['ca'] > 1:
                    print 6, 0, tmp_
                    return 0
            if tmp_['rr'] > 1 or tmp_['ra'] > 2:
                print 7, 0, tmp_
                return 0
            if tmp_['sr'] > 1 or tmp_['sa'] > 2:
                print 8, 0, tmp_
                return 0
        if tmp_['l'] > 0:
            if tmp_['rr'] > 0 or tmp_['ra'] > 1:
                print 9, 2, tmp_
                return 2
            if tmp_['cr'] > 0 or tmp_['ca'] > 1:
                print 10, 0, tmp_
                return 0
        return -1
170025
def get_results_sig(self):
        """"""
        # Only print results when uncorrected p-value < this value.
        print("{N:7,} of {M:,} results have uncorrected P-values <= {PVAL}=pval\n".format(
            N=sum(1 for r in self.results_all if r.p_uncorrected < self.args.pval),
            M=len(self.results_all),
            PVAL=self.args.pval))
        pval_fld = self.get_pval_field()
        results = [r for r in self.results_all if getattr(r, pval_fld) <= self.args.pval]
        return results
502628
private void printResultInfo(Status resultStatus, PrintWriter reportWriter) {
    switch (resultStatus) {
      case FAIL_TO_FIND_CLASS:
        reportWriter.println(FAIL_TO_FIND_CLASS_MESSAGE);
        reportWriter.println(TEST_FAILED_MESSAGE);
        break;
      case FAIL_TO_FIND_FS:
        reportWriter.println(FAIL_TO_FIND_FS_MESSAGE);
        reportWriter.println(TEST_FAILED_MESSAGE);
        break;
      case FAIL_TO_SUPPORT_HA:
        reportWriter.println(FAIL_TO_SUPPORT_HA_MESSAGE);
        reportWriter.println(TEST_FAILED_MESSAGE);
        break;
      default:
        reportWriter.println(TEST_PASSED_MESSAGE);
        break;
    }
  }
62002
public synchronized void printStatistics() {
        // quickly memoize and update counters, get the time, record update time, etc...
        long nowSuccesses = incrementCount.get();
        long nowFailures = failureCount.get();
        long prevSuccesss = lastPeriod.getAndSet(nowSuccesses);
        long endTime = System.currentTimeMillis();
        long startTime = lastStatsReportTS;
        lastStatsReportTS = endTime;

        // do math with as much safety as possible
        long invocationsCompleted = Math.max(nowSuccesses - prevSuccesss, 0);
        long periodDurationMs = Math.max(endTime - startTime, 1);
        long cumulativeDurationMs = Math.max(endTime - benchmarkStartTS, 1);
        long periodThroughput = (long) (invocationsCompleted / (periodDurationMs / 1000.0));
        long cumulativeThroughput = (long) (nowSuccesses / (cumulativeDurationMs / 1000.0));
        long time = (long) (Math.round(endTime - benchmarkStartTS) / 1000.0);

        // print out periodic report
        System.out.printf("%02d:%02d:%02d ", time / 3600, (time / 60) % 60, time % 60);
        System.out.printf("Period Throughput %10d/s, ", periodThroughput);
        System.out.printf("Cumulative Throughput %10d/s, ", cumulativeThroughput);
        System.out.printf("Total Failures %10d", nowFailures);
        System.out.printf("\n");
    }
991201
def action_stats(self, hostname=None):
        ""
        format = "%-35s %-11s %-11s %-11s %-11s"
        print format % ("HOST", "OPEN", "COMPLETED", "BYTES IN", "BYTES OUT")
        for host, details in sorted(self.client.stats(hostname).items()):
            print format % (
                host,
                details.get("open_requests", 0),
                details.get("completed_requests", 0),
                details.get("bytes_received", 0),
                details.get("bytes_sent", 0),
            )
860991
def dflt_sortby_objgoea(goea_res):
        """"""
        return [getattr(goea_res, 'enrichment'),
                getattr(goea_res, 'namespace'),
                getattr(goea_res, 'p_uncorrected'),
                getattr(goea_res, 'depth'),
                getattr(goea_res, 'GO')]
790887
def get_goea_nts_all(self, fldnames=None, **kws):
        
        # kws: prt_if indent itemid2name(study_items)
        data_nts = [] # A list of namedtuples containing GOEA results
        if not self.goea_results:
            return data_nts
        keep_if = kws.get('keep_if', None)
        rpt_fmt = kws.get('rpt_fmt', False)
        indent = kws.get('indent', False)
        # I. FIELD (column) NAMES
        not_fldnames = kws.get('not_fldnames', None)
        if fldnames is None:
            fldnames = self._get_fieldnames(self.goea_results[0])
        # Ia. Explicitly exclude specific fields from named tuple
        if not_fldnames is not None:
            fldnames = [f for f in fldnames if f not in not_fldnames]
        nttyp = cx.namedtuple("NtGoeaResults", " ".join(fldnames))
        goid_idx = fldnames.index("GO") if 'GO' in fldnames else None
        # II. Loop through GOEA results stored in a GOEnrichmentRecord object
        for goerec in self.goea_results:
            vals = self._get_field_values(goerec, fldnames, rpt_fmt, kws.get('itemid2name', None))
            if indent:
                vals[goid_idx] = "".join([goerec.get_indent_dots(), vals[goid_idx]])
            ntobj = nttyp._make(vals)
            if keep_if is None or keep_if(goerec):
                data_nts.append(ntobj)
        return data_nts
801018
synchronized void printStats() {
        String line1 = String.format("CACHE STATS - Literals: Hits %d/%d (%.1f%%), Inserts %d Evictions %d\n",
                m_literalHits, m_literalQueries, (m_literalHits * 100.0) / m_literalQueries,
                m_literalInsertions, m_literalEvictions);
        String line2 = String.format("CACHE STATS - Plans:    Hits %d/%d (%.1f%%), Inserts %d Evictions %d\n",
                m_planHits, m_planQueries, (m_planHits * 100.0) /m_planQueries,
                m_planInsertions, m_planEvictions);

        System.out.print(line1 + line2);
        System.out.flush();

        // reset these
        m_literalHits = 0;
        m_literalQueries = 0;
        m_literalInsertions = 0;
        m_literalEvictions = 0;
        m_planHits = 0;
        m_planQueries = 0;
        m_planInsertions = 0;
        m_planEvictions = 0;
    }
129848
def printComparison(results, class_or_prop):
	

	data = []

	Row = namedtuple('Row',[class_or_prop,'VALIDATED'])

	for k,v in sorted(results.items(), key=lambda x: x[1]):
		data += [Row(k, str(v))]

	pprinttable(data)
23591
def print_results_adj(results, indent=False, prt=sys.stdout):
        """"""
        # Print column headers if there are results to be printed
        if results:
            prt.write("{R}\n".format(R="\t".join(GOEnrichmentStudy.get_prtflds_default(results))))
        # Print the GOEA results
        for rec in results:
            prt.write("{R}\n".format(R=rec.__str__(indent=indent)))