Set a program's summary
540662
async def async_set_summary(program):
    '''
    
    '''
    import aiohttp
    async with aiohttp.ClientSession() as session:
        resp = await session.get(program.get('url'))
        text = await resp.text()
        summary = extract_program_summary(text)
        program['summary'] = summary
        return program
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))
902156
def summarize(self):
        ''''''

        self.speak('Here is a brief summary of {}.'.format(self.nametag))
        s = '\n'+pprint.pformat(self.__dict__)
        print(s.replace('\n', '\n'+' '*(len(self._prefix)+1)) + '\n')
54000
def update_summary_qc(data, key, base=None, secondary=None):
    
    summary = get_summary_qc(data, {})
    if base and secondary:
        summary[key] = {"base": base, "secondary": secondary}
    elif base:
        summary[key] = {"base": base}
    elif secondary:
        summary[key] = {"secondary": secondary}
    data = set_summary_qc(data, summary)
    return data
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()
1061676
def print_help(self, short=False):
        
        header = [
            u"",
            u"NAME",
            u"  %s - %s" % (self.NAME, self.HELP["description"]),
            u"",
        ]

        synopsis = [
            u"SYNOPSIS",
            u"  %s [-h|--help|--help-rconf|--version]" % (self.invoke),
        ]
        if "synopsis" in self.HELP:
            for syn, opt in self.HELP["synopsis"]:
                if opt:
                    opt = u" [OPTIONS]"
                else:
                    opt = u""
                synopsis.append(u"  %s %s%s" % (self.invoke, syn, opt))

        synopsis.append(u"")

        options = [
            u"  -h : print short help and exit",
            u"  --help : print full help and exit",
            u"  --help-rconf : list all runtime configuration parameters",
            u"  --version : print the program name and version and exit",
            u"  -l[=FILE], --log[=FILE] : log verbose output to tmp file or FILE if specified",
            u"  -r=CONF, --runtime-configuration=CONF : apply runtime configuration CONF",
            u"  -v, --verbose : verbose output",
            u"  -vv, --very-verbose : verbose output, print date/time values",
        ]
        if "options" in self.HELP:
            for opt in self.HELP["options"]:
                options.append(u"  %s" % (opt))
        options = [u"OPTIONS"] + sorted(options) + [u""]

        parameters = []
        if ("parameters" in self.HELP) and (len(self.HELP["parameters"]) > 0):
            parameters.append(u"PARAMETERS")
            for par in self.HELP["parameters"]:
                parameters.append(u"  %s" % (par))
            parameters.append(u"")

        examples = []
        if ("examples" in self.HELP) and (len(self.HELP["examples"]) > 0):
            examples.append(u"EXAMPLES")
            for exa in self.HELP["examples"]:
                examples.append(u"  %s %s" % (self.invoke, exa))
            examples.append(u"")

        footer = [
            u"EXIT CODES",
            u"  %d : no error" % (self.NO_ERROR_EXIT_CODE),
            u"  %d : error" % (self.ERROR_EXIT_CODE),
            u"  %d : help shown, no command run" % (self.HELP_EXIT_CODE),
            u"",
            u"AUTHOR",
            u"  Alberto Pettarin, http://www.albertopettarin.it/",
            u"",
            u"REPORTING BUGS",
            u"  Please use the GitHub Issues Web page : %s" % (self.ISSUES_URL),
            u"",
            u"COPYRIGHT",
            u"  2012-2017, Alberto Pettarin and ReadBeyond Srl",
            u"  This software is available under the terms of the GNU Affero General Public License Version 3",
            u"",
            u"SEE ALSO",
            u"  Code repository  : %s" % (self.GITHUB_URL),
            u"  Documentation    : %s" % (self.DOCS_URL),
            u"  Project Web page : %s" % (self.AENEAS_URL),
            u"",
        ]

        msg = header + synopsis + options + parameters + examples
        if not short:
            msg += footer
        if self.use_sys:
            self.print_generic(u"\n".join(msg))
        return self.exit(self.HELP_EXIT_CODE)
474435
def _summarize_result(result, summary):
    
    if "Bit for Bit" not in summary:
        summary["Bit for Bit"] = [0, 0]
    if "Configurations" not in summary:
        summary["Configurations"] = [0, 0]
    if "Std. Out Files" not in summary:
        summary["Std. Out Files"] = 0

    # Get the number of bit for bit failures
    total_count = 0
    failure_count = 0
    summary_data = None
    for elem in result:
        if elem["Type"] == "Bit for Bit" and "Data" in elem:
            elem_data = elem["Data"]
            summary_data = summary["Bit for Bit"]
            total_count += 1
            for var in six.iterkeys(elem_data):
                if elem_data[var]["Max Error"] != 0:
                    failure_count += 1
                    break
    if summary_data is not None:
        summary_data = np.add(summary_data, [total_count-failure_count, total_count]).tolist()
        summary["Bit for Bit"] = summary_data

    # Get the number of config matches
    summary_data = None
    total_count = 0
    failure_count = 0
    for elem in result:
        if elem["Title"] == "Configuration Comparison" and elem["Type"] == "Diff":
            elem_data = elem["Data"]
            summary_data = summary["Configurations"]
            total_count += 1
            failed = False
            for section_name, varlist in elem_data.items():
                for var, val in varlist.items():
                    if not val[0]:
                        failed = True
            if failed:
                failure_count += 1
    if summary_data is not None:
        success_count = total_count - failure_count
        summary_data = np.add(summary_data, [success_count, total_count]).tolist()
        summary["Configurations"] = summary_data

    # Get the number of files parsed
    for elem in result:
        if elem["Title"] == "Output Log" and elem["Type"] == "Table":
            summary["Std. Out Files"] += 1
            break
    return summary
691115
def _eval_summary(self, context: MonitorContext, feed_dict: Optional[Dict]=None) -> None:
        

        if self._summary is None:
            raise RuntimeError('TensorBoard monitor task should set the Tensorflow.Summary object')

        if context.session is None:
            raise RuntimeError('To run a TensorBoard monitor task the TF session object'
                               ' must be provided when creating an instance of the Monitor')

        summary = context.session.run(self._summary, feed_dict=feed_dict)
        self._file_writer.add_summary(summary, context.global_step)
        if self._flush_immediately:
            self.flush()
1140690
def put_summary(self, summary):
        
        if isinstance(summary, six.binary_type):
            summary = tf.Summary.FromString(summary)
        assert isinstance(summary, tf.Summary), type(summary)

        # TODO other types
        for val in summary.value:
            if val.WhichOneof('value') == 'simple_value':
                val.tag = re.sub('tower[0-9]+/', '', val.tag)   # TODO move to subclasses

                # TODO This hack is still needed, seem to disappear only when
                # compiled from source.
                suffix = '-summary'  # tensorflow#6150, tensorboard#59
                if val.tag.endswith(suffix):
                    val.tag = val.tag[:-len(suffix)]

                self._dispatch(lambda m: m.process_scalar(val.tag, val.simple_value))

        self._dispatch(lambda m: m.process_summary(summary))
400984
public void setSummary( final CharSequence summary) {
		if ( summary != null) format.getHeader().createEntry( SUMMARY, summary);
	}
987769
def check_summary(package_info, *args):
    
    reason = "Summary missing"
    result = False

    if package_info.get('summary') not in BAD_VALUES:
        result = True

    return result, reason, HAS_SUMMARY
1310442
public void setSummary(String subtotal, String shipping_cost, String total_tax, String total_cost)
    {
        this.summary.put("subtotal", subtotal);
        this.summary.put("shipping_cost", shipping_cost);
        this.summary.put("total_tax", total_tax);
        this.summary.put("total_cost", total_cost);
    }
1228128
def add_summaries(self, step, *tags_and_values):
    """"""
    values = []
    to_print = []
    for tag, value in tags_and_values:
      values.append(tf.Summary.Value(tag=tag, simple_value=float(value)))
      to_print.append('%s=%g' % (tag, value))
    if self._summary_writer:
      summary = tf.Summary(value=values)
      event = tf.Event(wall_time=time.time(),
                       summary=summary,
                       step=int(step))
      self._summary_writer.add_event(event)
    print('[%d] %s' % (step, ', '.join(to_print)))
466817
private void fillTotalCount(JsonObject summary) {
    if (totalCount == 0 && summary != null && summary.get("total_count") != null) {
      totalCount = summary.getLong("total_count", totalCount);
    }
  }
653495
def set_description(self):
        """"""
        try:
            self.description = self.soup.find('description').string
        except AttributeError:
            self.description = None
458475
def collect_program_info(self, fname):
        
        md = '#AIKIF Technical details\n'
        md += 'Autogenerated list of programs with comments and progress\n'
        md += '\nFilename | Comment | Date | Size\n'
        md += '--- | --- | --- | ---\n'
        for i in self.lstPrograms:
            md += self.get_file_info_line(i, ' | ')
        
        # save the details an Markdown file 
        with open(fname, 'w') as f:
            f.write(md)
881444
def _update_summary(self, system):
        
        self.basic.update({
            'nbus': system.Bus.n,
            'ngen': system.PV.n + system.SW.n,
            'ngen_on': sum(system.PV.u) + sum(system.SW.u),
            'nload': system.PQ.n,
            'nshunt': system.Shunt.n,
            'nline': system.Line.n,
            'ntransf': system.Line.trasf.count(True),
            'narea': system.Area.n,
        })