Write summary of level and depth counts for all active GO Terms.
10029
def write_summary_cnts_all(self):
        """"""
        cnts = self.get_cnts_levels_depths_recs(set(self.obo.values()))
        self._write_summary_cnts(cnts)
275636
def info(self, *args):
        """"""
        report = resolwe_runtime_utils.info(' '.join([str(x) for x in args]))
        # TODO: Use the protocol to report progress.
        print(report)
1010094
def get_hdr(self, goid, goobj):
        """'"""
        hdr = []
        ntgo = self.gosubdag.go2nt.get(goid)
        prt_flds = self._get_prtflds()
        # Add letter to depth-01 GO Node.
        if 'D1' in prt_flds and goobj.depth == 1:
            hdr.append("{ABC} ".format(ABC=ntgo.D1))
        hdr.append(self.str_fmthdr(goid, goobj))
        if 'level' in prt_flds:
            hdr.append("L{level}".format(level=goobj.level))
        if 'depth' in prt_flds:
            hdr.append("D{depth}".format(depth=goobj.depth))
        if 'reldepth' in prt_flds:
            hdr.append("R{reldepth}".format(reldepth=goobj.reldepth))
        # Print count of parents for this GO term
        if 'c2ps' in self.kws:
            self._add_parent_cnt(hdr, goobj, self.kws['c2ps'])
        # Print count of children for this GO term
        childcnt_str = self._get_hdr_childcnt(goobj, ntgo)
        if childcnt_str:
            hdr.append(childcnt_str)
        # Print count of all descendants down to the leaf-level for this GO term
        if 'dcnt' in prt_flds:
            hdr.append("d{N}".format(N=ntgo.dcnt))
        if 'tinfo' in prt_flds:
            hdr.append("i{I:4.02f}".format(I=ntgo.tinfo))
        if 'REL' in prt_flds:
            hdr.append("{R}".format(R=ntgo.REL_short))
        return " ".join(hdr)
1183433
def write_summary(all_procs, summary_file):
    
    if not summary_file:
        return

    with summary_file:
        writer = csv.writer(summary_file, delimiter='\t', lineterminator='\n')
        writer.writerow(('directory', 'command', 'start_time', 'end_time',
            'run_time', 'exit_status', 'result'))
        rows = ((p.working_dir, ' '.join(p.command), p.start_time, p.end_time,
                p.running_time, p.return_code, p.status) for p in all_procs)
        writer.writerows(rows)
1231508
def _load_type_counts(self):
		""""""

		rel_path = os.path.join(CLTK_DATA_DIR,
                                'old_english',
                                'model',
                                'old_english_models_cltk',
                                'data',
                                'oe.counts')
		path = os.path.expanduser(rel_path)

		self.type_counts = {}

		with open(path, 'r') as infile:
			lines = infile.read().splitlines()
			for line in lines:
				count, word = line.split()
				self.type_counts[word] = int(count)
1094219
def BuildStats(self):
    """"""
    artifact_reader = reader.YamlArtifactsReader()
    self.label_counts = {}
    self.os_counts = {}
    self.path_count = 0
    self.reg_key_count = 0
    self.source_type_counts = {}
    self.total_count = 0

    for artifact_definition in artifact_reader.ReadDirectory('data'):
      if hasattr(artifact_definition, 'labels'):
        for label in artifact_definition.labels:
          self.label_counts[label] = self.label_counts.get(label, 0) + 1

      for source in artifact_definition.sources:
        self.total_count += 1
        source_type = source.type_indicator
        self.source_type_counts[source_type] = self.source_type_counts.get(
            source_type, 0) + 1

        if source_type == definitions.TYPE_INDICATOR_WINDOWS_REGISTRY_KEY:
          self.reg_key_count += len(source.keys)
        elif source_type == definitions.TYPE_INDICATOR_WINDOWS_REGISTRY_VALUE:
          self.reg_key_count += len(source.key_value_pairs)
        elif source_type in (definitions.TYPE_INDICATOR_FILE,
                             definitions.TYPE_INDICATOR_DIRECTORY):
          self.path_count += len(source.paths)

        os_list = source.supported_os
        for os_str in os_list:
          self.os_counts[os_str] = self.os_counts.get(os_str, 0) + 1
1133040
def print_summary(self):
        
        # Emit class summaries for each snapshot
        classlist = self.tracked_classes

        fobj = self.stream

        fobj.write('---- SUMMARY '+'-'*66+'\n')
        for snapshot in self.snapshots:
            self.annotate_snapshot(snapshot)
            fobj.write('%-35s %11s %12s %12s %5s\n' % (
                trunc(snapshot.desc, 35),
                'active',
                pp(snapshot.asizeof_total),
                'average',
                'pct'
            ))
            for classname in classlist:
                info = snapshot.classes.get(classname)
                fobj.write('  %-33s %11d %12s %12s %4d%%\n' % (
                    trunc(classname, 33),
                    info['active'],
                    pp(info['sum']),
                    pp(info['avg']),
                    info['pct']
                ))
        fobj.write('-'*79+'\n')
1226523
def prt_hier_rec(self, item_id, depth=1):
        """"""
        # Shortens hierarchy report by only printing the hierarchy
        # for the sub-set of user-specified GO terms which are connected.
        if self.include_only and item_id not in self.include_only:
            return

        obj = self.id2obj[item_id]
        # Optionally space the branches for readability
        if self.space_branches:
            if depth == 1 and obj.children:
                self.prt.write("\n")
        # Print marks if provided
        if self.item_marks:
            self.prt.write('{MARK} '.format(
                MARK=self.item_marks.get(item_id, self.mark_dflt)))

        no_repeat = self.concise_prt and item_id in self.items_printed
        # Print content
        dashes = self._str_dash(depth, no_repeat, obj)
        if self.do_prtfmt:
            self._prtfmt(item_id, dashes)
        else:
            self._prtstr(obj, dashes)
        self.items_printed.add(item_id)
        self.items_list.append(item_id)
        # Do not print hierarchy below this turn if it has already been printed
        if no_repeat:
            return
        depth += 1
        if self.max_indent is not None and depth > self.max_indent:
            return
        children = obj.children if self.sortby is None else sorted(obj.children, key=self.sortby)
        for child in children:
            self.prt_hier_rec(child.item_id, depth)
1088611
def write_summary(duration, total, failures, pending)
      _write do |f|
        f.puts _message(total, failures, pending, duration)
        f.puts _failed_paths.join("\n") if failures > 0
      end
    end
743589
def __display_stats(self):
        """"""

        self.display('unify.tmpl', processed=self.total,
                     matched=self.matched,
                     unified=self.total - self.matched)
314417
def _summaries(self):
        
        for var in tf.trainable_variables():
            tf.summary.histogram(var.name, var)
            print(var.name)
1303347
private static void writeToLog(int level, long totalNanos, long count, ProfilingTimerNode parent, String taskName, Log log, String logAppendMessage) {
		if (log == null) {
			return;
		}

		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < level; i++) {
			sb.append('\t');
		}
		String durationText = String.format("%s%s",
				formatElapsed(totalNanos),
				count == 1 ?
						"" :
						String.format(" across %d invocations, average: %s", count, formatElapsed(totalNanos / count)));
		String text = parent == null ?
				String.format("total time %s", durationText) :
				String.format("[%s] took %s", taskName, durationText);
		sb.append(text);
		sb.append(logAppendMessage);
		log.info(sb.toString());
	}
957997
def log_summary(self):
        """"""
        participants = Participant.query.with_entities(Participant.status).all()
        counts = Counter([p.status for p in participants])
        sorted_counts = sorted(counts.items(), key=itemgetter(0))
        self.log("Status summary: {}".format(str(sorted_counts)))
        return sorted_counts
1050055
def wr_txt(self, fout_txt="gos_depth01.txt", title=None):
        """"""
        with open(fout_txt, 'w') as prt:
            self.prt_header(prt, title)
            data_nts = self.prt_txt(prt)
            sys.stdout.write("  {N:>5} items WROTE: {TXT}\n".format(
                N=len(data_nts), TXT=fout_txt))
476067
def do_summary(self, args):
        ''''''
        assert args.json or args.text or (args.text is None)
        do_text = args.text

        xd = {}
        for ws in self.task_master.iter_work_specs():
            name = ws['name']
            status = self.task_master.status(name)
            xd[name] = status
        xd['_NOW'] = time.time()

        if args.json:
            self.stdout.write(json.dumps(xd) + '\n')
        else:
            if do_text is None:
                do_text = True

        if do_text:
            self.stdout.write('Work spec               Avail  Pending  Blocked'
                              '   Failed Finished    Total\n')
            self.stdout.write('==================== ======== ======== ========'
                              ' ======== ======== ========\n')
            for name in sorted(xd.keys()):
                if name == '_NOW':
                    continue
                status = xd[name]
                self.stdout.write('{0:20s} {1[num_available]:8d} '
                                  '{1[num_pending]:8d} {1[num_blocked]:8d} '
                                  '{1[num_failed]:8d} {1[num_finished]:8d} '
                                  '{1[num_tasks]:8d}\n'.format(name, status))
1236910
def _create_counts(out_dts, out_dir):
    """"""
    ma, ma_mirna = _merge(out_dts)
    out_ma = op.join(out_dir, "counts.tsv")
    out_ma_mirna = op.join(out_dir, "counts_mirna.tsv")
    ma.to_csv(out_ma, sep="\t")
    ma_mirna.to_csv(out_ma_mirna, sep="\t")
    return out_ma_mirna, out_ma
1092360
def write_as_dot(self, f, data=None, max_levels=None):
        ""
        assert (max_levels is None) or (max_levels >= 0)
        def visit_node(n, levels):
            lbl = "{"
            if data is None:
                if self.k <= max_k_labeled:
                    lbl = repr(n.label()).\
                          replace("{","\{").\
                          replace("}","\}").\
                          replace("|","\|").\
                          replace("<","\<").\
                          replace(">","\>")
                else:
                    lbl = str(n)
            else:
                s = self.bucket_to_block(n.bucket)
                for i in xrange(self.blocks_per_bucket):
                    lbl += "{%s}" % (data[s+i])
                    if i + 1 != self.blocks_per_bucket:
                        lbl += "|"
            lbl += "}"
            f.write("  %s [penwidth=%s,label=\"%s\"];\n"
                    % (n.bucket, 1, lbl))
            levels += 1
            if (max_levels is None) or (levels <= max_levels):
                for i in xrange(self.k):
                    cn = n.child_node(i)
                    if not self.is_nil_node(cn):
                        visit_node(cn, levels)
                        f.write("  %s -> %s ;\n" % (n.bucket, cn.bucket))

        f.write("// Created by SizedVirtualHeap.write_as_dot(...)\n")
        f.write("digraph heaptree {\n")
        f.write("node [shape=record]\n")

        if (max_levels is None) or (max_levels > 0):
            visit_node(self.root_node(), 1)
        f.write("}\n")