Make subreport items from results.
485653
def make(self, apps):
        
        for (appname, app) in sorted(apps.items(), key=lambda x: (x[1].priority, x[0])):
            logger.info('Getting report results from %r', appname)

            for report_data in app.report_data:
                if report_data.subreport != self.name:
                    continue

                if report_data.function == 'total':
                    for opt in report_data:
                        match = report_data.parse_report_data(opt)
                        cond = match.group('condition')
                        valfld = match.group('valfld')
                        unit = match.group('unit')
                        itemtitle = match.group('fields').strip('"')

                        total = report_data.rules[opt].total_events(cond, valfld)
                        if total == 0:
                            continue

                        if unit is not None:
                            total, unit = get_value_unit(total, unit, 'T')
                            total = '{0} {1}'.format(total, unit)
                        else:
                            total = str(total)
                        report_data.results.append(tuple([total, itemtitle]))

                elif report_data.function == 'top':
                    k = int(report_data.topnum)
                    for opt in report_data:
                        match = report_data.parse_report_data(opt)

                        valfld = match.group('valfld')
                        field = match.group('fields')
                        usemax = match.group('add2res') is None

                        toplist = report_data.rules[opt].top_events(k, valfld, usemax, field)
                        report_data.results.extend(toplist)
                        
                elif report_data.function == 'table':
                    cols = len(re.split('\s*,\s*', report_data.headers))
                    for opt in report_data:
                        match = report_data.parse_report_data(opt)
                        cond = match.group('condition')
                        fields = re.split('\s*,\s*', match.group('fields'))
                        tablelist = report_data.rules[opt].list_events(cond, cols, fields)
                        report_data.results.extend(tablelist)

                if report_data.results:
                    self.report_data.append(report_data)

        # Sort and rewrite results as strings with units 
        for report_data in self.report_data:
            if report_data.function == 'top':
                # Sort values
                report_data.results = sorted(report_data.results, key=lambda x: x[0], reverse=True)

                # Get the unit if any and convert numeric results to strings
                unit = None
                for opt in report_data:
                    match = report_data.parse_report_data(opt)
                    unit = match.group('unit')
                    if unit is not None:
                        break

                for res in report_data.results:
                    if unit is not None:
                        v, u = get_value_unit(res[0], unit, 'T')
                        res[0] = '{0} {1}'.format(v, u)
                    else:
                        res[0] = str(res[0])
742533
private void reportResults(boolean replace, I_CmsReport report, int nrOfFiles) {

        // report entries
        if (replace) {
            // finish searching and replacing
            report.println(
                Messages.get().container(Messages.RPT_SOURCESEARCH_END_SEARCHING_REPLACING_0),
                I_CmsReport.FORMAT_HEADLINE);
        } else {
            // finish searching
            report.println(
                Messages.get().container(Messages.RPT_SOURCESEARCH_END_SEARCHING_0),
                I_CmsReport.FORMAT_HEADLINE);
        }
        // the results are written in the report
        report.println(Messages.get().container(Messages.RPT_SOURCESEARCH_RESULT_0), I_CmsReport.FORMAT_HEADLINE);
        report.println(
            Messages.get().container(
                Messages.RPT_SOURCESEARCH_NR_OF_FILES_TO_SEARCH_IN_1,
                new Integer(nrOfFiles).toString()),
            I_CmsReport.FORMAT_NOTE);
        report.println(
            Messages.get().container(
                Messages.RPT_SOURCESEARCH_NR_OF_FILES_MATCHED_1,
                new Integer(m_matchedResources.size()).toString()),
            I_CmsReport.FORMAT_NOTE);
        report.println(
            Messages.get().container(
                Messages.RPT_SOURCESEARCH_SEARCH_ERROR_COUNT_1,
                new Integer(m_errorSearch).toString()),
            I_CmsReport.FORMAT_NOTE);
        if (replace) {
            // replace report entries
            report.println(
                Messages.get().container(
                    Messages.RPT_SOURCESEARCH_REPLACE_ERROR_COUNT_1,
                    new Integer(m_errorUpdate).toString()),
                I_CmsReport.FORMAT_NOTE);
            report.println(
                Messages.get().container(
                    Messages.RPT_SOURCESEARCH_LOCKED_FILES_1,
                    new Integer(m_lockedFiles).toString()),
                I_CmsReport.FORMAT_NOTE);
            if (m_matchedResources.size() == 0) {
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_NO_FILES_FOUND_0),
                    I_CmsReport.FORMAT_OK);
            } else {
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_CLICK_OK_TO_GET_LIST_0),
                    I_CmsReport.FORMAT_OK);
            }
            if (m_lockedFiles > 0) {
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_REPLACE_FAILED_0),
                    I_CmsReport.FORMAT_ERROR);
            } else {
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_REPLACE_SUCCESS_0),
                    I_CmsReport.FORMAT_OK);
            }
        } else {
            // search report entries
            if (m_matchedResources.size() == 0) {
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_NO_FILES_FOUND_0),
                    I_CmsReport.FORMAT_OK);
            } else {
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_CLICK_OK_TO_GET_LIST_0),
                    I_CmsReport.FORMAT_OK);
            }
            if (m_errorSearch > 0) {
                // only searching failed
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_SEARCH_FAILED_0),
                    I_CmsReport.FORMAT_ERROR);
            } else {
                // only searching was successful
                report.println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_SEARCH_SUCCESS_0),
                    I_CmsReport.FORMAT_OK);
            }
        }
    }
568874
def process_results(self, paragraph):
        """"""
        if 'result' in paragraph and paragraph['result']['msg']:
            msg = paragraph['result']['msg']
            self.output_options[paragraph['result']['type']](msg)
174869
def collect_results(results_file):
    """"""
    with open(results_file, 'r') as results:
        data = json.load(results)
    return data
394740
def build_result(data):
    """"""
    more = {}
    for key, value  in data.items():
        if key != 'elements':
            newnode = value
        else:
            newnode = {}
            for el in value:
                nkey, nvalue = process_node(el)
                newnode[nkey] = nvalue

        more[key] = newnode

    return more
824375
def filter(self, table, items, filter_string):
        """"""
        query = filter_string.lower()
        return [item for item in items
                if query in item.name.lower()]
917742
def get_reports(self, **params):
        """"""
        response = self._get('v2', 'reports', data=params)
        return self._make_api_object(response, Report)
651153
def convert_items(self, items):
        """"""
        return ((key, self.convert(value, self)) for key, value in items)
1314503
def get_report(self, value):
        """"""
        if self.multiselect:
            value = value or []
            children = []

            for child in value:
                children.append(self.cast_to_report(child))

            return children

        return self.cast_to_report(value)
673560
def move_to_result(self, lst_idx):
        """"""
        self.in_result_idx.add(lst_idx)

        if lst_idx in self.not_in_result_root_match_idx:
            self.not_in_result_root_match_idx.remove(lst_idx)
742225
def calculate_report(labels, decodings, distances, losses):
    
    '''
    samples = pmap(process_decode_result, zip(labels, decodings, distances, losses))

    # Getting the WER and CER from the accumulated edit distances and lengths
    samples_wer, samples_cer = wer_cer_batch(labels, decodings)

    # Order the remaining items by their loss (lowest loss on top)
    samples.sort(key=lambda s: s.loss)

    # Then order by WER (highest WER on top)
    samples.sort(key=lambda s: s.wer, reverse=True)

    return samples_wer, samples_cer, samples
994654
def _validated(self, data):
        """"""
        for sub in self.schemas:
            data = sub(data)
        return data
1294761
def _print_results(results, stat=False, verbose=False):
    
    results.generate_pretty_output(stat=stat,
                                   verbose=verbose,
                                   output_function=click.secho)
73970
public void sub(IMatrix b, IMatrix result) {
        if ((b == null) || (rows != b.rows) || (columns != b.columns)) return;

        if ((result.rows != rows) || (result.columns != columns)) result.reshape(rows, columns);

        int i, j;
        for (i = 0; i < rows; i++)
            for (j = 0; j < columns; j++) {
                result.realmatrix[i][j] = realmatrix[i][j] - b.realmatrix[i][j];
                result.imagmatrix[i][j] = imagmatrix[i][j] - b.imagmatrix[i][j];
            }
    }
193010
def combine_results(self, results):
        """"""
        result = {}
        for key in results[0]:
            result[key] = numpy.concatenate([r[key] for r in results])
        return result
733135
def filter_ranks(results):
    
    for _, group in itertools.groupby(results, operator.itemgetter(0)):
        yield next(group)
738376
def results(self):
        ""
        cur = self._conn.cursor()
        rows = cur.execute("SELECT * FROM results")
        for row in rows:
            yield (row['job_id'], _row_to_work_result(row))