Resposible for constructing a report to be output as part of the build.
		Returns report as a string.
336760
def build_report(self, msg=''):
		
		shutit_global.shutit_global_object.yield_to_draw()
		s = '\n'
		s += '################################################################################\n'
		s += '# COMMAND HISTORY BEGIN ' + shutit_global.shutit_global_object.build_id + '\n'
		s += self.get_commands()
		s += '# COMMAND HISTORY END ' + shutit_global.shutit_global_object.build_id + '\n'
		s += '################################################################################\n'
		s += '################################################################################\n'
		s += '# BUILD REPORT FOR BUILD BEGIN ' + shutit_global.shutit_global_object.build_id + '\n'
		s += '# ' + msg + '\n'
		if self.build['report'] != '':
			s += self.build['report'] + '\n'
		else:
			s += '# Nothing to report\n'
		if 'container_id' in self.target:
			s += '# CONTAINER_ID: ' + self.target['container_id'] + '\n'
		s += '# BUILD REPORT FOR BUILD END ' + shutit_global.shutit_global_object.build_id + '\n'
		s += '###############################################################################\n'
		s += '# INVOKING COMMAND WAS: ' + sys.executable
		for arg in sys.argv:
			s += ' ' + arg
		s += '\n'
		s += '###############################################################################\n'
		return s
1098314
def build_report(job_ini, output_dir=None):
    
    calc_id = logs.init()
    oq = readinput.get_oqparam(job_ini)
    if oq.calculation_mode == 'classical':
        oq.calculation_mode = 'preclassical'
    oq.ground_motion_fields = False
    output_dir = output_dir or os.path.dirname(job_ini)
    from openquake.calculators import base  # ugly
    calc = base.calculators(oq, calc_id)
    calc.save_params()  # needed to save oqparam

    # some taken is care so that the real calculation is not run:
    # the goal is to extract information about the source management only
    calc.pre_execute()
    if oq.calculation_mode == 'preclassical':
        calc.execute()
    rw = ReportWriter(calc.datastore)
    rw.make_report()
    report = (os.path.join(output_dir, 'report.rst') if output_dir
              else calc.datastore.export_path('report.rst'))
    try:
        rw.save(report)
    except IOError as exc:  # permission error
        sys.stderr.write(str(exc) + '\n')
    readinput.exposure = None  # ugly hack
    return report
558665
def create_report(self):
        """"""
        data = self.create_data()
        try:
            json_string = json.dumps(data)
        except UnicodeDecodeError as e:
            log.error('ERROR: While preparing JSON:', exc_info=e)
            self.debug_bad_encoding(data)
            raise

        log_string = re.sub(r'"repo_token": "(.+?)"',
                            '"repo_token": "[secure]"', json_string)
        log.debug(log_string)
        log.debug('==\nReporting %s files\n==\n', len(data['source_files']))
        for source_file in data['source_files']:
            log.debug('%s - %s/%s', source_file['name'],
                      sum(filter(None, source_file['coverage'])),
                      len(source_file['coverage']))
        return json_string
1144152
def save_report_to_html(self):
        """"""
        html = self.page().mainFrame().toHtml()
        if self.report_path is not None:
            html_to_file(html, self.report_path)
        else:
            msg = self.tr('report_path is not set')
            raise InvalidParameterError(msg)
520030
public void build(@NonNull ReportExecutor reportExecutor) {
        if (message == null && exception == null) {
            message = "Report requested by developer";
        }

        reportExecutor.execute(this);
    }
1287792
def get_report(self):
        

        lines = [
            self.name,
            '=' * len(self.name)
        ]

        if self.info is not None:
            lines.append('')
            sorted_info = sorted(self.info.items(), key=lambda x: x[0])
            lines.extend(['--> {}: {}'.format(k, v) for k, v in sorted_info])

        lines.append('')
        lines.append('Result: {}'.format('Passed' if self.passed else 'Failed'))

        return '\n'.join(lines)
1056110
def dump(self):
        
        report_as_json_string = utils.dict_to_json(self.report)
        if self.out_file:
            utils.string_to_file(self.out_file, report_as_json_string)
        else:
            print report_as_json_string
1133451
def formatMessageForBuildResults(self, mode, buildername, buildset, build, master, previous_results, blamelist):
        """"""
        ss_list = buildset['sourcestamps']
        results = build['results']

        ctx = dict(results=build['results'],
                   mode=mode,
                   buildername=buildername,
                   workername=build['properties'].get(
                       'workername', ["<unknown>"])[0],
                   buildset=buildset,
                   build=build,
                   projects=self.getProjects(ss_list, master),
                   previous_results=previous_results,
                   status_detected=self.getDetectedStatus(
                       mode, results, previous_results),
                   build_url=utils.getURLForBuild(
                       master, build['builder']['builderid'], build['number']),
                   buildbot_url=master.config.buildbotURL,
                   blamelist=blamelist,
                   summary=self.messageSummary(build, results),
                   sourcestamps=self.messageSourceStamps(ss_list)
                   )
        yield self.buildAdditionalContext(master, ctx)
        msgdict = self.renderMessage(ctx)
        return msgdict
373045
private void buildReport(Context context) {
        try {
            buildBaseReport();
            buildApplicationData(context);
            buildDeviceData(context);
            buildLog();
            report.put("application", app);
            report.put("device", device);
            report.put("log", logs);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
319162
def main(**kwargs):
    
    draw_lines()
    draw_histogram()
    draw_bar_chart()
    destination = "-r /report"
    if use_html:
        generate_html()
        command = "dx-build-report-html {h} {d}".format(h=html_filename, d=destination)
    else:
        command = "dx-build-report-html {l} {b} {h} {d}".format(l=lines_filename, b=bars_filename, h=histogram_filename, d=destination)
    sub_output = json.loads(subprocess.check_output(command, shell=True))
    output = {}
    output["report"] = dxpy.dxlink(sub_output["recordId"])
    return output
1213818
def report(ctx, board, done, output):
    ctx.obj['board_id'] = board
    ts = TrelloStats(ctx.obj)
    
    ct = cycle_time(ts, board, done)
    env = get_env()

    #  Get all render functions from the module and filter out the ones we don't want.
    render_functions = [target for target in
                     dir(sys.modules['trellostats.reports'])
                     if target.startswith("render_") and
                     target.endswith(output)]
    
    for render_func in render_functions:
        print globals()[render_func](env, **dict(cycle_time=ct))
706116
def get_report(self):
    
    ostr = ''
    ostr += "Nodes: "+str(len(self.__nodes.keys()))+"\n"
    ostr += "Edges: "+str(len(self.__edges.keys()))+"\n"
    return ostr
268925
def generate_report(self):
        

        print("making plot for {}".format(self.outname))
        # make the markdown file to log to while doing analyses
        logfile_filepath = os.path.join(
            self.reportDir,
            "{0}_report.md".format(self.outname))

        #check if seld.reportDir exists
        # if not, make it
        if not os.path.exists(self.reportDir):
            print("making the directory: {}".format(self.reportDir))
            os.makedirs(self.reportDir)

        logfile = open(logfile_filepath, 'w')

        # make a title in the markdown file
        print("# {0}".format(self.outname), file=logfile)
        print("## Meraculous assembly QC analysis", file=logfile)

        # 0. Run params
        print("### 0. Run params", file=logfile)
        print("", file=logfile)
        print("- mer_size: `{}`".format(self.mer_size), file=logfile)
        print("- diploid_mode: `{}`".format(self.diploid_mode), file=logfile)
        print("- genome_size: `{}`".format(self.genome_size), file=logfile)
        print("- min_depth_cutoff: `{}`".format(self.min_depth_cutoff), file=logfile)
        print("", file=logfile)

        # 1. get the mercount and kha plot
        print("### 1. `meraculous_mercount` output", file = logfile)
        print("", file=logfile)
        print("#### `mercount.png`", file = logfile)
        print("", file=logfile)
        mercountFromPath = os.path.join(self.homeBasename, "meraculous_mercount/mercount.png")
        mercountToPath = os.path.join(self.reportDir, "mercount.png")
        mercountHTML = os.path.join(
            os.path.basename(os.path.split(mercountToPath)[0]),
            os.path.basename(mercountToPath))
        shutil.copyfile(mercountFromPath, mercountToPath)
        print("![mercount]({0})".format(mercountHTML),
            file=logfile)
        print("", file=logfile)
        print("#### `kha.png`", file = logfile)
        print("", file=logfile)
        khaFromPath = os.path.join(self.homeBasename, "meraculous_mercount/kha.png")
        khaToPath = os.path.join(self.reportDir, "kha.png")
        khaHTML = os.path.join(
            os.path.basename(os.path.split(khaToPath)[0]),
            os.path.basename(khaToPath))
        shutil.copyfile(khaFromPath, khaToPath)
        print("![kha]({0})".format(khaHTML),
            file=logfile)
        print("", file=logfile)

        # 2. run fasta_stats on UUtig.fa
        # this is the result of the first contigs produced by meraculous_contigs
        print("### 2. `fasta_stats UUtigs.fa`", file=logfile)
        print("", file=logfile)
        print("""This is the output of `meraculous_contigs`. In a diploid genome,
              the total length of all contigs at this stage should be
              larger than the expected genome size because of the
              presence of haplotype variant UUtigs. (Meraculous
              manual)""", file=logfile)
        print("",file=logfile)
        print("```", file=logfile)
        callString="fasta_stats {0}".format(
            "{}/meraculous_contigs/UUtigs.fa".format(self.home))
        self.call_sys(callString, logfile)
        print("```", file=logfile)
        print("",file=logfile)

        if int(self.diploid_mode) == 1:
            #2.5. Check out the output of meraculous_bubble
            print("### 2.5. Diploid mode plot", file=logfile)
            print("", file=logfile)
            print("""- If there are two peaks, and the "half-depth" peak is much larger
                  than the one at full depth, that's a scenario that's
                  best handled by diploid_mode 2.  If it's the
                  opposite, make sure the parameter
                  'bubble_depth_threshold' is being set correctly (if
                  auto-detected, the result is written into
                  `meraculous_bubble/haplotigs.dmin.err`) - E. Goltsman.""",
                  file=logfile)
            print("""- For diploid assemblies, you should examine the file
                  haplotigs.depth.hist.png and verify that there are
                  two distinct peaks, one at roughly half depth of the
                  other. At this point you may want to check your
                  bubble_depth_threshold parameter and adjust it to a
                  value corresponding to the local minimum between the
                  two peaks (_ if you had originally set it to 0
                  Meraculous auto-detects this threshold_). - Meraculous Manual""",
                  file=logfile)
            print("", file=logfile)
            bblFromPath = os.path.join(self.homeBasename,
                                       "meraculous_bubble/haplotigs.depth.hist.png")
            bblToPath = os.path.join(self.reportDir, "haplotigs.depth.hist.png")
            bblHTML = os.path.join(
                os.path.basename(os.path.split(bblToPath)[0]),
                os.path.basename(bblToPath))
            shutil.copyfile(bblFromPath, bblToPath)
            print("![bbl]({0})".format(bblHTML),
                   file=logfile)
            print("", file=logfile)
            bbl_detect=os.path.join(self.home, "meraculous_bubble/haplotigs.dmin.err")
            if os.path.exists(bbl_detect):
                #in a later version, just look at the meraculous log file
                print("", file=logfile)
                print("#### `bubble_depth_threshold` auto-detected", file=logfile)
                print("", file=logfile)
                print("```", file=logfile)
                callString="cat {0}".format(bbl_detect)
                self.call_sys(callString, logfile)
                print("```", file=logfile)
                print("", file=logfile)
            else:
                print("", file=logfile)
                print("#### `bubble_depth_threshold` was user-input", file=logfile)
                print("", file=logfile)
            print("#### `fasta_stats meraculous_bubble/haplotigs.fa", file=logfile)
            print("", file=logfile)
            print("""- These are the assembly stats after running
                  `meraculous_bubble`.""", file=logfile)
            print("", file=logfile)
            print("```", file=logfile)
            callString="fasta_stats {0}".format(
            os.path.join(self.home, "meraculous_bubble/haplotigs.fa"))
            self.call_sys(callString, logfile)
            print("```", file=logfile)
            print("", file=logfile)

        if int(self.diploid_mode) == 1:
            print("### 2.6. Note on `meraculous_ono` with `diploid_mode=1`", file=logfile)
            print("", file=logfile)
            print("""- [ Note: If running in diploid_mode 1, the scaffolding is initially
                performed using combined linkage info from alternative
                variant diplotigs, i.e., both variants contribute read
                pairs to the same link as if they were one and the
                same contig. Then, using haplotype-specific read
                mapping info, phased variant paths are determined and
                the scaffold content is corrected in a haplotype
                consistent manner. As a result, one variant path
                (typically one with the higher overall depth) will be
                preserved in a multi-contig scaffold while the
                individual alternative variants are represented as
                unlinked, singleton scaffolds. A list of these
                singleton alternative variant scaffolds is also
                saved. For more on diploid-aware assembly, see section
                ‘Diploid assembly’. ] - _Meraculous manual_""", file=logfile)

        print("### 3. `meraculous_gap_closure`", file=logfile)
        print("", file=logfile)
        print("#### 3.1 `final.scaffolds.fa`", file=logfile)
        print("", file=logfile)
        print("```", file=logfile)
        callString="fasta_stats {0}".format(
            os.path.join(self.home, "meraculous_gap_closure/final.scaffolds.fa"))
        self.call_sys(callString, logfile)
        print("```", file=logfile)
        print("", file=logfile)

        if int(self.diploid_mode) == 1:
            print("#### 3.1. Note on haplotype final scaffolds", file=logfile)
            print("", file=logfile)
            print("""- [Note: when running in diploid_mode 1, if a gap
            represents a polymorphic region that had been actively
            removed earlier (i.e., a half-depth isotig), Meraculous
            will attempt to walk across it using reads from the more
            abundant allele]. - _Meraculous manual_""", file=logfile)
            print("""- When running in diploid_mode 1, a “single-haplotype” sequence
            file (final.scaffolds.single-haplotype.fa) where the
            alternative variant scaffolds have been removed is also
            created. - _Meraculous manual_""", file=logfile)
            print("", file=logfile)
            print("```", file=logfile)
            callString="fasta_stats {0}".format(
                os.path.join(self.home, "meraculous_gap_closure/final.scaffolds.single-haplotype.fa"))
            self.call_sys(callString, logfile)
            print("```", file=logfile)
            print("", file=logfile)

        print("### 4. `meraculous_final_results`", file=logfile)
        print("""- The final output of meraculous""", file=logfile)
        print("", file=logfile)
        print("```", file=logfile)
        callString="fasta_stats {0}".format(
            os.path.join(self.home, "meraculous_final_results/final.scaffolds.fa"))
        self.call_sys(callString, logfile)
        print("```", file=logfile)
        print("", file=logfile)

        # this block handles the printing the meraculous log to the new output
        # directory
        print("### 5. `meraculous_log`", file=logfile)
        print("""- The final output of meraculous""", file=logfile)
        print("", file=logfile)
        print("```", file=logfile)
        callString="cat {0}".format(
            os.path.join(self.home, "log/meraculous.log"))
        output, err = self.call_sys(callString, logfile)
        print("```", file=logfile)
        print("", file=logfile)
        new_mer_log_path = os.path.join(self.reportDir, "meraculous.log")
        with open (new_mer_log_path, "w") as f:
            print(output, file=f)

        logfile.close()
        self.make_HTML(logfile_filepath)
1303188
def build(self):
        """"""

        if not self.embed:
            mkdir_recursive(self.output_directory)

        # get list of script files in build order
        self.build_order = remove_dups(
            reduce(lambda a, b: a + glob.glob(b),
                   self.build_targets,
                   []))
        self.build_order_output = [self.out_path_of(t)
                                   for (t) in self.build_order]
        self.path_mapping = dict(zip(
            self.build_order,
            self.build_order_output))

        self.compiled_scripts = {}
        exceptions, values = partition(
            lambda x: isinstance(x, Exception),
            [self.compile_and_process(target)
             for target in self.build_order])

        self.compiled_scripts.update(dict(values))

        saneExceptions, insaneExceptions = partition(
            lambda x: isinstance(x, TaskExecutionException),
            exceptions)

        if len(insaneExceptions) != 0:
            raise insaneExceptions[0]

        if len(exceptions) != 0:
            raise TaskExecutionException(
                "Precompiler Errors (%s):" % type(self).__name__,
                "\n".join([
                    x.header + "\n    " +
                    x.message.replace("\n", "\n    ")
                    for x in exceptions]))

        return self.collect_output()
891039
def dump_report_content(self, request, result):
        

        output = StringIO()
        writer = csv.writer(output, **self.csv_kwargs)
        writer.writerows([result.headers] + result.values)
        return output.getvalue()
916096
def build_data(self):
        
        # pylint: disable=len-as-condition
        if len(self.dutinformation) > 0 and (self.dutinformation.get(0).build is not None):
            return self.dutinformation.get(0).build.get_data()
        return None
1176502
def get_build_output(self, process):
        

        while True:
            output = process.stdout.readline()
            if output == b'' and process.poll() is not None:
                if process.returncode > 0:
                    raise Exception("Compilation ended with an error"
                                    ".\nSTDERR\n%s\nSTDOUT\n%s" %
                                    (process.stderr.read(),
                                     process.stdout.read()))
                return
            if output:
                # Parse the output to get current and total tasks
                # This assumes the progress displayed by waf is in the form
                # [current/total]
                matches = re.search(r'\[\s*(\d+?)/(\d+)\].*',
                                    output.strip().decode('utf-8'))
                if matches is not None:
                    yield [int(matches.group(1)), int(matches.group(2))]