Print the summary
558647
def summary(processors, metrics, context):
    """"""
    # display aggregated metric values on language level
    def display_header(processors, before='', after=''):
        """Display the header for the summary results."""
        print(before, end=' ')
        for processor in processors:
            processor.display_header()
        print(after)

    def display_separator(processors, before='', after=''):
        """Display the header for the summary results."""
        print(before, end=' ')
        for processor in processors:
            processor.display_separator()
        print(after)

    def display_metrics(processors, before='', after='', metrics=[]):
        """Display the header for the summary results."""
        print(before, end=' ')
        for processor in processors:
            processor.display_metrics(metrics)
        print(after)

    summary = {}
    for m in metrics:
        lang = metrics[m]['language']
        has_key = lang in summary
        if not has_key:
            summary[lang] = {'file_count': 0, 'language': lang}
        summary[lang]['file_count'] += 1
        for i in metrics[m]:
            if i not in ['sloc', 'comments', 'mccabe']:  # include metrics to be used
                continue
            if not has_key:
                summary[lang][i] = 0
            summary[lang][i] += metrics[m][i]

    total = {'language': 'Total'}
    for m in summary:
        for i in summary[m]:
            if i == 'language':
                continue
            if i not in total:
                total[i] = 0
            total[i] += summary[m][i]

    print('Metrics Summary:')

    display_header(processors, 'Files', '')
    display_separator(processors, '-'*5, '')
    for k in sorted(summary.keys(), key=str.lower):
        display_metrics(processors, '%5d' %
                        summary[k]['file_count'], '', summary[k])
    display_separator(processors, '-'*5, '')
    display_metrics(processors, '%5d' % total['file_count'],
                    '', total)
940629
def prt_summary(self, prt=sys.stdout):
        """"""
        # Grouping summary
        fmtstr = "Grouped: {U:3,} User GOs, using {h:2,} of {H:,} Grouping GOs, for run: {NAME}\n"
        prt.write(fmtstr.format(
            NAME=self.grpname,
            U=len(self.usrgos),
            h=len(self.hdrobj.hdrgos.intersection(self.hdrgo2usrgos.keys())),
            H=self.hdrobj.num_hdrgos()))
1013970
public void printMethodsSummary(ClassDoc classDoc) {
        MethodDoc[] methodDocs = TestAPIDoclet.getTestAPIComponentMethods(classDoc);
        if (methodDocs.length > 0) {
            mOut.println("<P>");
            mOut.println("<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">");
            mOut.println("<TR BGCOLOR=\"#CCCCFF\"><TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\"><B>Methods "
                  + "Summary</B></FONT></TH></TR>");
            for (MethodDoc methodDoc : methodDocs) {
                String methodName = methodDoc.name();
                mOut.print(
                      "<TR><TD WIDTH=\"1%\"><CODE><B><A HREF=\"#" + methodName + methodDoc.flatSignature() + "\">" + methodName
                            + "</A></B></CODE></TD><TD>");
                Tag[] firstSentenceTags = methodDoc.firstSentenceTags();
                if (firstSentenceTags.length == 0) {
                    System.err.println("Warning: method " + methodName + " of " + methodDoc.containingClass().simpleTypeName()
                          + " has no description");
                }
                printInlineTags(firstSentenceTags, classDoc);
                mOut.println("</TD>");
            }

            mOut.println("</TABLE>");
        }
    }
1176214
def Print(self):
        """"""
        for val, prob in sorted(self.d.iteritems()):
            print(val, prob)
120455
def render_summary(self, include_title=True):
        """"""
        title = ""
        classes = ["traceback"]
        if not self.frames:
            classes.append("noframe-traceback")
            frames = []
        else:
            library_frames = sum(frame.is_library for frame in self.frames)
            mark_lib = 0 < library_frames < len(self.frames)
            frames = [group.render(mark_lib=mark_lib) for group in self.groups]

        if include_title:
            if self.is_syntax_error:
                title = u"Syntax Error"
            else:
                title = u"Traceback <em>(most recent call last)</em>:"

        if self.is_syntax_error:
            description_wrapper = u"<pre class=syntaxerror>%s</pre>"
        else:
            description_wrapper = u"<blockquote>%s</blockquote>"

        return SUMMARY_HTML % {
            "classes": u" ".join(classes),
            "title": u"<h3>%s</h3>" % title if title else u"",
            "frames": u"\n".join(frames),
            "description": description_wrapper % escape(self.exception),
        }
816467
function() {

            var self = this;
            var summary = 
                self.tableSummaryBuilder(self.groupsSummary,
                                         self.pagesSummary, 
                                         self.total);
            $('#' + self.getId('summary')).html(summary);

        }
486411
public function printSummary() {
    drush_print();

    // Print env files used for this definition.
    drush_print($this->formatHeading('Environment Definitions Found'));
    foreach ($this->loadedEnvs as $filename) {
      drush_print("{$filename}", 1);
    }

    drush_print();
    drush_print($this->formatHeading(dt("CONFIGURATION SUMMARY")));

    // We want to make sure they are printed in the same order as they will run.
    foreach ($this->getActiveDefinition() as $group => $options) {
      // Print a nice heading.
      $heading = $this->formatHeading($group);

      switch (strtolower($group)) {
        case 'modules':
          $this->printModuleSummary($options, $heading);
          break;

        case 'variables':
          $this->printVariableSummary($options, $heading);
          break;

        case 'permissions':
          $this->printPermissionSummary($options, $heading);
          break;

        case 'commands':
          $this->printCommandSummary($options, $heading);
          break;

        default:
          drush_print($this->formatHeading($group));
          drush_log(dt("I'm not sure what to do with '@group'.", ['@group' => $group]), 'warning');
          break;
      }
    }
  }
1072919
def summary(self, summary):
        """"""
        if summary is not None:
            if summary == 'Clear':
                click.secho("""

   ________                    \  |  /
  / ____/ /__  ____ ______       .-.
 / /   / / _ \/ __ `/ ___/    ‒ (   ) ‒
/ /___/ /  __/ /_/ / /           `-᾿
\____/_/\___/\__,_/_/          /  |  \\

                """, fg=self.colors.YELLOW)
                click.echo()

            elif summary == 'Partly Cloudy':
                click.secho("""

    ____             __  __         ________                __
   / __ \____ ______/ /_/ /_  __   / ____/ /___  __  ______/ /_  __    \  |  /
  / /_/ / __ `/ ___/ __/ / / / /  / /   / / __ \/ / / / __  / / / /      .-.
 / ____/ /_/ / /  / /_/ / /_/ /  / /___/ / /_/ / /_/ / /_/ / /_/ /    ‒ (  .-.
/_/    \__,_/_/   \__/_/\__, /   \____/_/\____/\__,_/\__,_/\__, /        `(   ).
                       /____/                             /____/       / (___(__)

                """, fg=self.colors.WHITE)

            elif summary == 'Flurries':
                click.secho("""

    ________                _                  .--.
   / ____/ /_  ____________(_)__  _____     .-(    ).
  / /_  / / / / / ___/ ___/ / _ \/ ___/    (___.__)__)
 / __/ / / /_/ / /  / /  / /  __(__  )      *      *
/_/   /_/\__,_/_/  /_/  /_/\___/____/          *

                """, fg=self.colors.BLUE)
                click.echo()

            elif summary == 'Overcast' or summary == 'Mostly Cloudy':
                click.secho("""

   ____                                  __
  / __ \_   _____  ______________ ______/ /_       .--.
 / / / / | / / _ \/ ___/ ___/ __ `/ ___/ __/     .(    ).-.
/ /_/ /| |/ /  __/ /  / /__/ /_/ (__  ) /_      (___.__(   ).
\____/ |___/\___/_/   \___/\__,_/____/\__/            (___(__)

                """, fg=self.colors.WHITE)
                click.echo()

            elif summary == 'Snow':
                click.secho("""

   _____                            .--.
  / ___/____  ____ _      __     .-(    ).
  \__ \/ __ \/ __ \ | /| / /    (___.__)__)
 ___/ / / / / /_/ / |/ |/ /      *   *   *
/____/_/ /_/\____/|__/|__/         *   *

                """, fg=self.colors.BLUE)
                click.echo()

            elif summary == 'Light Snow':
                click.secho("""

    __    _       __    __    _____
   / /   (_)___ _/ /_  / /_  / ___/____  ____ _      __       .--.
  / /   / / __ `/ __ \/ __/  \__ \/ __ \/ __ \ | /| / /    .-(    ).
 / /___/ / /_/ / / / / /_   ___/ / / / / /_/ / |/ |/ /    (___.__)__)
/_____/_/\__, /_/ /_/\__/  /____/_/ /_/\____/|__/|__/       *  *  *
        /____/
                """, fg=self.colors.BLUE)
                click.echo()

            elif summary == 'Light Rain' or summary == 'Drizzle':
                click.secho("""

    __    _       __    __     ____        _
   / /   (_)___ _/ /_  / /_   / __ \____ _(_)___       .--.
  / /   / / __ `/ __ \/ __/  / /_/ / __ `/ / __ \   .-(    ).
 / /___/ / /_/ / / / / /_   / _, _/ /_/ / / / / /  (___.__)__)
/_____/_/\__, /_/ /_/\__/  /_/ |_|\__,_/_/_/ /_/     /  /  /
        /____/

                """, fg=self.colors.BLUE)

            elif summary == 'Rain':
                click.secho("""

    ____        _
   / __ \____ _(_)___       .--.
  / /_/ / __ `/ / __ \   .-(    ).
 / _, _/ /_/ / / / / /  (___.__)__)
/_/ |_|\__,_/_/_/ /_/     /  /  /

                """, fg=self.colors.BLUE)

            else:
                click.secho("{:=^62}".format(str(summary)), fg=self.colors.GREEN)
1255384
def print_summary(self):
        
        # True positives = matched reference samples
        self.tp = len(self.matched_ref_inds)
        # False positives = extra test samples not matched
        self.fp = self.n_test - self.tp
        # False negatives = undetected reference samples
        self.fn = self.n_ref - self.tp
        # No tn attribute

        self.specificity = self.tp / self.n_ref
        self.positive_predictivity = self.tp / self.n_test
        self.false_positive_rate = self.fp / self.n_test

        print('%d reference annotations, %d test annotations\n'
            % (self.n_ref, self.n_test))
        print('True Positives (matched samples): %d' % self.tp)
        print('False Positives (unmatched test samples: %d' % self.fp)
        print('False Negatives (unmatched reference samples): %d\n' % self.fn)

        print('Specificity: %.4f (%d/%d)'
            % (self.specificity, self.tp, self.n_ref))
        print('Positive Predictivity: %.4f (%d/%d)'
            % (self.positive_predictivity, self.tp, self.n_test))
        print('False Positive Rate: %.4f (%d/%d)'
            % (self.false_positive_rate, self.fp, self.n_test))
629047
def toc_print(self):
        """"""
        res = self.toc()
        for n, k, v in res:
            logging.info('Batch: {:7d} {:30s} {:s}'.format(n, k, v))
891750
def print_chain_summary(self, stream=sys.stdout, indent=""):
        
        stream.write("%sTotal files      : %i\n" %
                     (indent, len(self.file_dict)))
        stream.write("%s  Input files    : %i\n" %
                     (indent, len(self.chain_input_files)))
        stream.write("%s  Output files   : %i\n" %
                     (indent, len(self.chain_output_files)))
        stream.write("%s  Internal files : %i\n" %
                     (indent, len(self.internal_files)))
        stream.write("%s  Temp files     : %i\n" %
                     (indent, len(self.temp_files)))
1115088
public function renderSummary()
	{
		if(($count=$this->dataProvider->getItemCount())<=0)
			return;

		echo CHtml::openTag($this->summaryTagName, array('class'=>$this->summaryCssClass));
		if($this->enablePagination)
		{
			$pagination=$this->dataProvider->getPagination();
			$total=$this->dataProvider->getTotalItemCount();
			$start=$pagination->currentPage*$pagination->pageSize+1;
			$end=$start+$count-1;
			if($end>$total)
			{
				$end=$total;
				$start=$end-$count+1;
			}
			if(($summaryText=$this->summaryText)===null)
				$summaryText=Yii::t('zii','Displaying {start}-{end} of 1 result.|Displaying {start}-{end} of {count} results.',$total);
			echo strtr($summaryText,array(
				'{start}'=>$start,
				'{end}'=>$end,
				'{count}'=>$total,
				'{page}'=>$pagination->currentPage+1,
				'{pages}'=>$pagination->pageCount,
			));
		}
		else
		{
			if(($summaryText=$this->summaryText)===null)
				$summaryText=Yii::t('zii','Total 1 result.|Total {count} results.',$count);
			echo strtr($summaryText,array(
				'{count}'=>$count,
				'{start}'=>1,
				'{end}'=>$count,
				'{page}'=>1,
				'{pages}'=>1,
			));
		}
		echo CHtml::closeTag($this->summaryTagName);
	}
718388
def summary(self):
        """"""

        res = ("nlive: {:d}\n"
               "niter: {:d}\n"
               "ncall: {:d}\n"
               "eff(%): {:6.3f}\n"
               "logz: {:6.3f} +/- {:6.3f}"
               .format(self.nlive, self.niter, sum(self.ncall),
                       self.eff, self.logz[-1], self.logzerr[-1]))

        print('Summary\n=======\n'+res)
1010855
def _charSummary(self, char_count, block_count=None):
        
        if not self._display['omit_summary']:
            if block_count is None:
                print('Total code points:', char_count)
            else:
                print('Total {0} code point{1} in {2} block{3}'.format(
                    char_count,
                    's' if char_count != 1 else '',
                    block_count,
                    's' if block_count != 1 else ''
                ))
146891
def show(self):
        
        self.data()
        print("")
        self.msg.template(78)
        print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
        self.msg.template(78)
        for key, value in self.dmap.iteritems():
            print("  {0}{1}{2}{3}{4}".format(
                self.green, key, self.endc, " " * (32-len(key)),
                ", ".join(value)))
        self.summary()
        if self.image:
            Graph(self.image).dependencies(self.dmap)
1320092
public void printSummary() {
        StringBuilder res = new StringBuilder();
        res.append("Num. studies: ").append(variantMetadata.getStudies().size()).append("\n");
        int counter, studyCounter = 0;
        for (VariantStudyMetadata study: variantMetadata.getStudies()) {
            studyCounter++;
            res.append("\tStudy #").append(studyCounter).append(": ").append(study.getId()).append("\n");

            res.append("\tNum. files: ").append(study.getFiles().size()).append("\n");
            counter = 0;
            for (VariantFileMetadata file: study.getFiles()) {
                counter++;
                res.append("\t\tFile #").append(counter).append(": ").append(file.getId());
                res.append(" (").append(file.getSampleIds().size()).append(" samples)\n");
            }

            res.append("\tNum. cohorts: ").append(study.getCohorts().size()).append("\n");
            counter = 0;
            for (Cohort cohort: study.getCohorts()) {
                counter++;
                res.append("\t\tCohort #").append(counter).append(": ").append(cohort.getId());
                res.append(" (").append(cohort.getSampleIds().size()).append(" samples)\n");
            }
        }
        System.out.println(res.toString());
    }
152070
def summary(args):
    
    p = OptionParser(summary.__doc__)
    p.add_option("--strict", default=False, action="store_true",
                help="Strict 'gapless' mode. Exclude gaps from covered base.")
    p.add_option("--tabular", default=False, action="store_true",
                help="Print succint tabular output")

    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    blastfile, = args

    alignstats = get_stats(blastfile, strict=opts.strict)
    if opts.tabular:
        print(str(alignstats))
    else:
        alignstats.print_stats()