Generate the data for the Overview section in the report
        :return:
761355
def sec_overview(self):
        

        """ Data sources overview: table with metric summaries"""
        metrics = self.config['overview']['activity_metrics']
        file_name = self.config['overview']['activity_file_csv']

        data_path = os.path.join(self.data_dir, "data")
        file_name = os.path.join(data_path, file_name)

        logger.debug("CSV file %s generation in progress", file_name)

        csv = 'metricsnames,netvalues,relativevalues,datasource\n'
        for metric in metrics:
            # comparing current metric month count with previous month
            es_index = self.get_metric_index(metric)
            ds = metric.ds.name
            m = metric(self.es_url, es_index, start=self.start, end=self.end)
            (last, percentage) = m.get_trend()
            csv += "%s,%i,%i,%s" % (metric.name, last, percentage, ds)
            csv += "\n"
        os.makedirs(os.path.dirname(file_name), exist_ok=True)
        with open(file_name, "w") as f:
            # Hack, we need to fix LaTeX escaping in a central place
            csv = csv.replace("_", r"\_")
            f.write(csv)

        logger.debug("CSV file: %s was generated", file_name)

        """
        Git Authors:

        description: average number of developers per month by quarters
        (so we have the average number of developers per month during
        those three months). If the approach is to work at the level of month,
        then just the number of developers per month.
        """

        author = self.config['overview']['author_metrics'][0]
        csv_labels = 'labels,' + author.id
        file_label = author.ds.name + "_" + author.id
        title_label = author.name + " per " + self.interval
        self.__create_csv_eps(author, None, csv_labels, file_label, title_label)

        logger.debug("CSV file %s generation in progress", file_name)

        bmi = []
        ttc = []  # time to close

        csv_labels = ''
        for m in self.config['overview']['bmi_metrics']:
            metric = m(self.es_url, self.get_metric_index(m),
                       start=self.end_prev_month, end=self.end)
            csv_labels += m.id + ","
            bmi.append(metric.get_agg())

        for m in self.config['overview']['time_to_close_metrics']:
            metric = m(self.es_url, self.get_metric_index(m),
                       start=self.end_prev_month, end=self.end)
            csv_labels += m.id + ","
            ttc.append(metric.get_agg())

        csv = csv_labels[:-1] + "\n"  # remove last comma
        csv = csv.replace("_", "")
        for val in bmi:
            csv += "%s," % (self.str_val(val))
        for val in ttc:
            csv += "%s," % (self.str_val(val))
        if csv[-1] == ',':
            csv = csv[:-1]

        data_path = os.path.join(self.data_dir, "data")
        file_name = os.path.join(data_path, 'efficiency.csv')
        os.makedirs(os.path.dirname(file_name), exist_ok=True)
        with open(file_name, "w") as f:
            f.write(csv)

        logger.debug("CSV file: %s was generated", file_name)
443916
def overview():
    '''
    
    '''
    cmd = 'drbd-overview'
    for line in __salt__['cmd.run'](cmd).splitlines():
        ret = {}
        fields = line.strip().split()
        minnum = fields[0].split(':')[0]
        device = fields[0].split(':')[1]
        connstate, _ = _analyse_overview_field(fields[1])
        localrole, partnerrole = _analyse_overview_field(fields[2])
        localdiskstate, partnerdiskstate = _analyse_overview_field(fields[3])
        if localdiskstate.startswith("UpTo"):
            if partnerdiskstate.startswith("UpTo"):
                if len(fields) >= 5:
                    mountpoint = fields[4]
                    fs_mounted = fields[5]
                    totalsize = fields[6]
                    usedsize = fields[7]
                    remainsize = fields[8]
                    perc = fields[9]
                    ret = {
                        'minor number': minnum,
                        'device': device,
                        'connection state': connstate,
                        'local role': localrole,
                        'partner role': partnerrole,
                        'local disk state': localdiskstate,
                        'partner disk state': partnerdiskstate,
                        'mountpoint': mountpoint,
                        'fs': fs_mounted,
                        'total size': totalsize,
                        'used': usedsize,
                        'remains': remainsize,
                        'percent': perc,
                    }
                else:
                    ret = {
                        'minor number': minnum,
                        'device': device,
                        'connection state': connstate,
                        'local role': localrole,
                        'partner role': partnerrole,
                        'local disk state': localdiskstate,
                        'partner disk state': partnerdiskstate,
                    }
            else:
                syncbar = fields[4]
                synced = fields[6]
                syncedbytes = fields[7]
                sync = synced+syncedbytes
                ret = {
                    'minor number': minnum,
                    'device': device,
                    'connection state': connstate,
                    'local role': localrole,
                    'partner role': partnerrole,
                    'local disk state': localdiskstate,
                    'partner disk state': partnerdiskstate,
                    'synchronisation: ': syncbar,
                    'synched': sync,
                }
    return ret
322223
def build_report(self):
        
        thresholds = self.thresholds
        lower_quantile = self.config['lower_quantile']
        upper_quantile = self.config['upper_quantile']

        if self.n_current_results > self.n_cached_curves:
            # If there are new curves, recompute
            colnames = ['_'.join([metric, stat])
                        for metric in [self.metric1.name, self.metric2.name]
                        for stat in ['Mean', 'Median',
                                     '%d_Percentile' % (100*lower_quantile),
                                     '%d_Percentile' % (upper_quantile*100)]]
            self.ret = pd.DataFrame(columns=colnames, index=thresholds, dtype='float64')

            for threshold in thresholds:
                m1s = Series([self.metric1.score(result, threshold) for result in self.results])
                m2s = Series([self.metric2.score(result, threshold) for result in self.results])
                self.ret.loc[threshold] = (m1s.mean(), m1s.quantile(.5), m1s.quantile(.05), m1s.quantile(.95),
                                           m2s.mean(), m2s.quantile(.5), m2s.quantile(.05), m2s.quantile(.95))
        self.build_curves()
        self.summary_df = self.ret
        return self.ret
1029596
def get_summary(self):
        """"""
        if not self.analysis_finished:
            return []
        summary = {'times_summary': []}
        for i in range(len(self.runs[self.current_run].steps) - 1):
            step = self.runs[self.current_run].steps[i]
            begin = parse(step['when'])
            end = parse(self.runs[self.current_run].steps[i + 1]['when'])
            duration = end - begin
            summary['times_summary'].append((step['step'], duration.seconds))
        return summary
238004
def get_worksheets_section(self):
        
        out = []
        bc = getToolByName(self.context, CATALOG_WORKSHEET_LISTING)
        query = {'portal_type': "Worksheet", }

        # Check if dashboard_cookie contains any values to query
        # elements by
        query = self._update_criteria_with_filters(query, 'worksheets')

        # Active Worksheets (all)
        total = self.search_count(query, bc.id)

        # Open worksheets
        name = _('Results pending')
        desc = _('Results pending')
        purl = 'worksheets?list_review_state=open'
        query['review_state'] = ['open', 'attachment_due']
        out.append(self._getStatistics(name, desc, purl, bc, query, total))

        # Worksheets to be verified
        name = _('To be verified')
        desc = _('To be verified')
        purl = 'worksheets?list_review_state=to_be_verified'
        query['review_state'] = ['to_be_verified', ]
        out.append(self._getStatistics(name, desc, purl, bc, query, total))

        # Worksheets verified
        name = _('Verified')
        desc = _('Verified')
        purl = 'worksheets?list_review_state=verified'
        query['review_state'] = ['verified', ]
        out.append(self._getStatistics(name, desc, purl, bc, query, total))

        # Chart with the evolution of WSs over a period, grouped by
        # periodicity
        outevo = self.fill_dates_evo(bc, query)
        out.append({'type':         'bar-chart-panel',
                    'name':         _('Evolution of Worksheets'),
                    'class':        'informative',
                    'description':  _('Evolution of Worksheets'),
                    'data':         json.dumps(outevo),
                    'datacolors':   json.dumps(self.get_colors_palette())})

        return {'id': 'worksheets',
                'title': _('Worksheets'),
                'panels': out}
1221617
def reporter(self):
        
        # Create a folder in which amplicons and raw BLAST results are to be stored
        detailed_reports = os.path.join(self.path, 'detailed_reports')
        make_path(detailed_reports)
        # Create the report path if necessary
        make_path(self.reportpath)
        with open(self.report, 'w') as report:
            # Initialise the header
            data = 'Sample,Gene,GenomeLocation,AmpliconSize,Contig,ForwardPrimers,ReversePrimers,' \
                   'ForwardMismatches,ReverseMismatches\n'
            for sample in self.metadata:
                # Initialise variables to convert attributes from set to list
                sample[self.analysistype].genes = dict()
                sample[self.analysistype].ntrange = dict()
                try:
                    # Check to ensure that there were amplicons present
                    if sample[self.analysistype].range:
                        # Iterate through each contig with genes present, and the list of genes on the contig
                        for contig, genes in sorted(sample[self.analysistype].genespresent.items()):
                            sample[self.analysistype].genes[contig] = list(genes)
                            # Iterate through the set of genes
                            for gene in sorted(genes):
                                # Determine which primers had the best lowest number of mismatches
                                # Create variables to store primer names, and number of mismatches
                                forward = list()
                                reverse = list()
                                forwardmismatches = int()
                                reversemismatches = int()
                                # Sort the dictionary of mismatches based on the number of mismatches
                                sorteddict = sorted(sample[self.analysistype].mismatches[contig][gene].items(),
                                                    key=operator.itemgetter(1))
                                # For every primer in the sorted dictionary, check to see if it is a forward or
                                # reverse primer, and determine the number of mismatches; if it is the first primer
                                # encountered for a gene, add it to the list, as because the dictionary is sorted,
                                # the number of mismatches should be the best. Additionally, if subsequent primer
                                # hits have the same number of mismatches, also add them to the list
                                for entry in sorteddict:
                                    # Add primer to the list if it is the first primer encountered
                                    if '-F' in entry[0] and not forward:
                                        forward.append(entry[0])
                                        forwardmismatches = entry[1]
                                    # Add the primer to the list if it has the same number of mismatches as a previous
                                    # primer in the list
                                    elif '-F' in entry[0] and entry[1] == forwardmismatches:
                                        forward.append(entry[0])
                                        forwardmismatches = entry[1]
                                    elif '-R' in entry[0] and not reverse:
                                        reverse.append(entry[0])
                                        reversemismatches = entry[1]
                                    elif '-R' in entry[0] and entry[1] == reversemismatches:
                                        reverse.append(entry[0])
                                        reversemismatches = entry[1]
                                # Make a variable to prevent writing out this long attribute name multiple times
                                ntrange = list(sample[self.analysistype].range[contig][gene])
                                sample[self.analysistype].ntrange[gene] = ntrange
                                # Extract the amplicons from the sequence file
                                self.ampliconfile(sample, contig, sorted(ntrange), forward, reverse)
                                # Copy the amplicons and raw BLAST outputs from FASTQ-formatted files to the
                                # detailed_reports folder
                                if sample[self.analysistype].filetype == 'fastq':
                                    try:
                                        shutil.copyfile(src=sample[self.analysistype].ampliconfile,
                                                        dst=os.path.join(detailed_reports,
                                                                         '{sn}_amplicons.fa'.format(sn=sample.name)))
                                        shutil.copyfile(src=sample[self.analysistype].report,
                                                        dst=os.path.join(detailed_reports,
                                                                         '{sn}_rawresults.csv'.format(sn=sample.name)))
                                    except FileNotFoundError:
                                        pass
                                # This first gene for a sample gets the sample name printed
                                data += '{sn},'.format(sn=sample.name)
                                # Populate the string with the gene name, properly formatted range, the length of
                                # the amplicon, and the name of the contig on which the gene was found
                                data += '{},{},{},{},{},{},{},{}\n'\
                                    .format(gene,
                                            '-'.join(str(x) for x in sorted(ntrange)),
                                            max(ntrange) - min(ntrange) + 1,
                                            contig,
                                            ';'.join(sorted(forward)),
                                            ';'.join(sorted(reverse)),
                                            forwardmismatches,
                                            reversemismatches)
                    # If there were no amplicons, add the sample name and nothing else
                    else:
                        data += '{sn}\n'.format(sn=sample.name)
                # If there were no BLAST hits, add the sample name, and nothing else
                except AttributeError:
                    data += '{sn}\n'.format(sn=sample.name)
                # Remove attributes that either take up too much room in the .json output, or are not JSON serializable
                try:
                    delattr(sample[self.analysistype], "blastresults")
                except AttributeError:
                    pass
                try:
                    delattr(sample[self.analysistype], "genespresent")
                except AttributeError:
                    pass
                try:
                    delattr(sample[self.analysistype], "contigs")
                except AttributeError:
                    pass
                try:
                    delattr(sample[self.analysistype], "range")
                except AttributeError:
                    pass
            # Write the string to the report
            report.write(data)
        # Clean up the BLAST database files
        db = os.path.splitext(self.formattedprimers)[0]
        # A list of all the file extensions associated with the BLASTdb
        dbextensions = ['.nhr', '.nin', '.nog', '.nsd', '.nsi', '.nsq']
        # Iterate through all the files, and delete each one - pass on IO errors
        for dbfile in zip(itertools.repeat(db), dbextensions):
            try:
                os.remove(''.join(dbfile))
            except IOError:
                pass
        try:
            os.remove(self.formattedprimers)  # Maybe want to keep this file?
        except IOError:
            pass
838759
def get_report_rst(self):
        
        res = ''
        res += '-----------------------------------\n' 
        res += self.nme  + '\n'
        res += '-----------------------------------\n\n'
        res += self.desc + '\n'
        res += self.fldr + '\n\n'
        res += '.. contents:: \n\n\n'

        res += 'Overview\n' + '===========================================\n\n'
        res += 'This document contains details on the project ' + self.nme + '\n\n'
        
        for d in self.details:
            res += ' - ' + d[0] + ' = ' + d[1] + '\n\n'
            
        
        res += '\nTABLES\n' + '===========================================\n\n'
        
        for t in self.datatables:
            res +=  t.name + '\n'
            res += '-------------------------\n\n'
            res += t.format_rst() + '\n\n'
        
        
        
        return res
1334359
def create_summary(self):
        
        if not self.ignore_self:
            res = summary.summarize(muppy.get_objects())
        else:
            # If the user requested the data required to store summaries to be
            # ignored in the summaries, we need to identify all objects which
            # are related to each summary stored.
            # Thus we build a list of all objects used for summary storage as
            # well as a dictionary which tells us how often an object is
            # referenced by the summaries.
            # During this identification process, more objects are referenced,
            # namely int objects identifying referenced objects as well as the
            # correspondind count.
            # For all these objects it will be checked wether they are
            # referenced from outside the monitor's scope. If not, they will be
            # subtracted from the snapshot summary, otherwise they are
            # included (as this indicates that they are relevant to the
            # application).

            all_of_them = []  # every single object
            ref_counter = {}  # how often it is referenced; (id(o), o) pairs
            def store_info(o):
                all_of_them.append(o)
                if id(o) in ref_counter:
                    ref_counter[id(o)] += 1
                else:
                    ref_counter[id(o)] = 1

            # store infos on every single object related to the summaries
            store_info(self.summaries)
            for k, v in self.summaries.items():
                store_info(k)
                summary._traverse(v, store_info)

            # do the summary
            res = summary.summarize(muppy.get_objects())

            # remove ids stored in the ref_counter
            for _id in ref_counter:
                # referenced in frame, ref_counter, ref_counter.keys()
                if len(gc.get_referrers(_id)) == (3):
                    summary._subtract(res, _id)
            for o in all_of_them:
                # referenced in frame, summary, all_of_them
                if len(gc.get_referrers(o)) == (ref_counter[id(o)] + 2):
                    summary._subtract(res, o)

        return res
99857
def overview
      @sessions = Gricer.config.session_model.browsers.between_dates(@stat_from, @stat_thru)
      @requests = Gricer.config.request_model.browsers.between_dates(@stat_from, @stat_thru)
      
      render partial: 'overview', formats: [:html], locals: {sessions: @sessions, requests: @requests}
    end
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)
513259
def _create_raw_data(self):
        
        result = {}
        for section in self.get_sections():
            result[section.get('id')] = 'all'
        return result
624065
def lifetime_report(args, parser):
    """"""
    catalogue = utils.get_catalogue(args)
    tokenizer = utils.get_tokenizer(args)
    results = tacl.Results(args.results, tokenizer)
    output_dir = os.path.abspath(args.output)
    os.makedirs(output_dir, exist_ok=True)
    report = tacl.LifetimeReport()
    report.generate(output_dir, catalogue, results, args.label)
573321
def overview(game_id):
    """"""
    output = {}
    # get data
    overview = mlbgame.data.get_overview(game_id)
    # parse data
    overview_root = etree.parse(overview).getroot()

    try:
        output = add_raw_box_score_attributes(output, game_id)
    except ValueError:
        pass

    # get overview attributes
    for x in overview_root.attrib:
        output[x] = overview_root.attrib[x]

    # Get probable starter attributes if they exist
    home_pitcher_tree = overview_root.find('home_probable_pitcher')
    if home_pitcher_tree is not None:
        output.update(build_namespaced_attributes(
            'home_probable_pitcher', home_pitcher_tree))
    else:
        output.update(build_probable_starter_defaults('home'))

    away_pitcher_tree = overview_root.find('away_probable_pitcher')
    if away_pitcher_tree is not None:
        output.update(build_namespaced_attributes(
            'away_probable_pitcher', away_pitcher_tree))
    else:
        output.update(build_probable_starter_defaults('away'))

    return output
14695
private function detailed()
    {
        if (!$this->done && in_array('--detailed-report', $this->params)) {
            $this->done = true;
            $details = $this->getDetailsForUser(!in_array('--open-out', $this->params));
            if ($details !== false) {
                $counterReport = \common_report_Report::createInfo('Detailed report for the user');
                $helper = new ConsoleTableHelper();
                $helper->addHeader(['TestTaker', 'Deliveries', 'Executions']);
                $helper->addRows($details);
                $counterReport->add($helper->generateReport());
                $this->report->add($counterReport);
            }
        }
    }
51658
def show(cls, report_name, data):
        
        conn = Qubole.agent()
        return conn.get(cls.element_path(report_name), data)
484719
def overview(self, tag=None, fromdate=None, todate=None):
        
        return self.call("GET", "/stats/outbound", tag=tag, fromdate=fromdate, todate=todate)
318735
def sections(self):
        
        secs = OrderedDict()
        secs['Overview'] = self.sec_overview
        secs['Communication Channels'] = self.sec_com_channels
        secs['Detailed Activity by Project'] = self.sec_projects

        return secs