returns: tuple containing
       * single-line summary candidate 
       * key points
       in the format specified.
420196
def summarize_url(url, num_sentences=4, fmt='default'):
    '''
    '''

    title, meta, full_text = goose_extractor(url)

    if not full_text:
        raise ArticleExtractionFail("Couldn't extract: {}".format(url))

    its = _intertext_score(full_text)
    tss = _title_similarity_score(full_text,title)

    if _eval_meta_as_summary(meta):
        summ = meta
        if tss[0][2].lower() in summ.lower():
            its, tss = _remove_title_from_tuples(its, tss)
        elif summ.lower() in tss[0][2].lower():
            summ = tss[0][2]
            its, tss = _remove_title_from_tuples(its, tss)
    else:
        summ = tss[0][2]
        its, tss = _remove_title_from_tuples(its, tss)

    scores = [score[2] for score in _aggregrate_scores(its, tss, num_sentences)]
    formatted = Formatter(scores, fmt).frmt()
    return summ, formatted
177381
def extract(self, item, article_candidate_list):
        
        list_text = []

        # The minimal number of words a text needs to have
        min_number_words = 15

        # The texts of the article candidates and the respective extractors are saved in a tuple in list_text.
        for article_candidate in article_candidate_list:
            if article_candidate.text != None:
                list_text.append((article_candidate.text, article_candidate.extractor))

        # Remove texts that are shorter than min_number_words.
        for text_tuple in list_text:
            if len(text_tuple[0].split()) < min_number_words:
                list_text.remove(text_tuple)

        # If there is no value in the list, return None.
        if len(list_text) == 0:
            return None

        # If there is only one solution, return it.
        if len(list_text) < 2:
            return list_text[0][0]
        else:

            # If there is more than one solution, do the following:

            # Create a list which holds triple of the score and the two extractors
            list_score = []

            # Compare every text with all other texts at least once
            for a, b, in itertools.combinations(list_text, 2):

                # Create sets from the texts
                set_a = set(a[0].split())
                set_b = set(b[0].split())
                symmetric_difference_a_b = set_a ^ set_b
                intersection_a_b = set_a & set_b

                # Replace 0 with -1 in order to elude division by zero
                if intersection_a_b == 0:
                    intersection_a_b = -1

                # Create the score. It divides the number of words which are not in both texts by the number of words which
                # are in both texts and subtracts the result from 1. The closer to 1 the more similiar they are.
                score = 1 - ((len(symmetric_difference_a_b)) / (2 * len(intersection_a_b)))
                list_score.append((score, a[1], b[1]))

            # Find out which is the highest score
            best_score = max(list_score, key=lambda item: item[0])

            # If one of the solutions is newspaper return it
            if "newspaper" in best_score:
                return (list(filter(lambda x: x[1] == "newspaper", list_text))[0][0])
            else:
                # If not, return the text that is longer

                # A list that holds the extracted texts and their extractors which were most similar
                top_candidates = []
                for tuple in list_text:
                    if tuple[1] == best_score[1] or tuple[1] == best_score[2]:
                        top_candidates.append(tuple)

                if len(top_candidates[0][0]) > len(top_candidates[1][0]):
                    return (top_candidates[0][0])
                else:
                    return (top_candidates[1][0])
60917
def summarize_sv(items):
    
    items = [utils.to_single_data(x) for x in vcvalidate.summarize_grading(items, "svvalidate")]
    out = {"sv": {"calls": [],
                  "supplemental": [],
                  "prioritize": {"tsv": [],
                                 "raw": []}},
           "svvalidate": vcvalidate.combine_validations(items, "svvalidate")}
    added = set([])
    # Standard callers
    for data in items:
        if data.get("sv"):
            if data["sv"].get("vrn_file"):
                ext = utils.splitext_plus(data["sv"]["vrn_file"])[-1]
                cur_name = _useful_basename(data)
                if cur_name not in added and ext.startswith(".vcf"):
                    added.add(cur_name)
                    out_file = os.path.join(utils.safe_makedir(os.path.join(dd.get_work_dir(data),
                                                                            "sv", "calls")),
                                            "%s%s" % (cur_name, ext))
                    utils.copy_plus(data["sv"]["vrn_file"], out_file)
                    out_file = vcfutils.bgzip_and_index(out_file, data["config"])
                    out["sv"]["calls"].append(out_file)
            if data["sv"].get("supplemental"):
                out["sv"]["supplemental"].extend([x for x in data["sv"]["supplemental"] if x])
    # prioritization
    for pdata in _group_by_sample(items):
        prioritysv = [x for x in prioritize.run([utils.deepish_copy(pdata)])[0].get("sv", [])
                      if x["variantcaller"] == "sv-prioritize"]
        if prioritysv:
            out["sv"]["prioritize"]["tsv"].append(prioritysv[0]["vrn_file"])
            out["sv"]["prioritize"]["raw"].extend(prioritysv[0]["raw_files"].values())
    return [out]
533580
def summary(self):  # type: ignore
        
        if not self.translations:
            self.update()
        return [summary.taf(trans) for trans in self.translations.forecast]
999236
def summary(self):
        
        m = self
        txt = "%-34s (Bits: %5.2f  MAP: %7.2f   D: %5.3f  %3d)  E: %7.3f"%(
            m, m.totalbits, m.MAP, m.seeddist, m.seednum, nlog10(m.pvalue))
        if m.binomial!=None:  txt = txt + '  Bi: %6.2f'%(nlog10(m.binomial))
        if m.church != None:  txt = txt + '  ch: %6.2f'%(nlog10(m.church))
        if m.frac   != None:  txt = txt + '  f: %5.3f'%(m.frac)
        if m.E_site != None:  txt = txt + '  Es: %6.2f'%(nlog10(m.E_site))
        if m.E_seq  != None:  txt = txt + '  Eq: %6.2f'%(nlog10(m.E_seq))
        if m.MNCP   != None:  txt = txt + '  mn: %6.2f'%(m.MNCP)
        if m.ROC_auc!= None:  txt = txt + '  Ra: %6.4f'%(m.ROC_auc)
        if m.E_chi2 != None:
            if m.E_chi2 == 0: m.E_chi2=1e-20
            txt = txt + ' x2: %5.2f'%(nlog10(m.E_chi2))
        if m.CRA    != None:  txt = txt + '  cR: %6.4f'%(m.CRA)
        if m.Cfrac  != None:  txt = txt + '  Cf: %5.3f'%(m.Cfrac)
        if m.realpvalue != None: txt = txt + '  P: %6.4e'%(m.realpvalue)
        if m.kellis != None:  txt = txt +  '  k: %6.2f'%(m.kellis)
        if m.numbound      :  txt = txt +  '  b: %3d'%(m.numbound)
        if m.nummotif      :  txt = txt +  '  nG: %3d'%(m.nummotif)
        if m.numboundmotif :  txt = txt +  '  bn: %3d'%(m.numboundmotif)

        return txt
773683
def commit_format(self):
        
        formatted_analyses = []
        for analyze in self.analysis['messages']:
            formatted_analyses.append({
                'message': f"{analyze['source']}: {analyze['message']}. Code: {analyze['code']}",
                'file': analyze['location']['path'],
                'line': analyze['location']['line'],
            })

        return formatted_analyses
1202610
def summary(self):
        
        if self.hasSummary:
            return GaussianMixtureSummary(super(GaussianMixtureModel, self).summary)
        else:
            raise RuntimeError("No training summary available for this %s" %
                               self.__class__.__name__)
120220
public Summary toSummary(List<Keyword> keywords) {

        if (keywords == null) {
            keywords = new ArrayList<>();
        }

        if (keywords.isEmpty()) {

            KeyWordComputer kc = new KeyWordComputer(10);
            keywords = kc.computeArticleTfidf(title, content);
        }
        return explan(keywords, content);
    }
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')
470975
def description(self):
        
        if self._closed:
            return

        description = []
        for col in self._result["cols"]:
            description.append((col,
                                None,
                                None,
                                None,
                                None,
                                None,
                                None))
        return tuple(description)
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
1305118
def get_summary(url, spk=True):
    ''' '''
    # connect to file at URL
    bspurl = urllib2.urlopen(url)
    # retrieve the "tip" of a file at URL
    bsptip = bspurl.read(10**5) # first 100kB
    # save data in fake file object (in-memory)
    bspstr = StringIO(bsptip)
    # load into DAF object
    daf = DAF(bspstr)
    # return either SPK or DAF object
    if spk:
      # make a SPK object
      spk = SPK(daf)
      # return representation 
      return spk
    else:
      # return representation 
      return daf
997743
def from_summary_line(cls, summaryLine, version=4, existing_object=None):
        ''' 
        '''
        if not summaryLine:
            raise ValueError('No summary line given')
        if version == 4:
            params = summaryLine.split()
            if len(params) != 25:
                print params
                raise TypeError('Expected 25 columns, {0} given'.format(len(params)))
            input_params = params[0:1] + params[3:23]
            if not existing_object:
                retval = cls(*input_params)
            else:
                assert isinstance(existing_object, tno)
                assert existing_object.name == params[0]
                retval = existing_object
            retval.mean_mag = float(params[1])
            retval.mean_mag_stdev = float(params[2])
            retval.ra_discov = float(params[23])
            retval.dec_discov = float(params[24])
        else:
            raise VersionError('Unknown version "{0}"'.format(version))
        assert retval
        return retval
727939
def contents_list_pairs(self):
        ''''''
        return (tuple(getattr(self.generator, name) for name in names)
                for names in self.info.get('contents_lists', []))
146717
def get_summary_data(self, sec2d_nt):
        """"""
        grouped = set()
        ungrouped = set()
        sections = set()
        secdflt = self.grprobj.hdrobj.secdflt
        for section_name, nts in sec2d_nt:
            if section_name != secdflt:
                if nts:
                    grouped.update(set(nt.GO for nt in nts))
                    sections.add(section_name)
                else:
                    ungrouped.update(set(nt.GO for nt in nts))
        return {'grouped':grouped, 'ungrouped':ungrouped, 'sections':sections}
846252
def _get_points(self):
        
        return tuple([self._getitem__points(i)
                     for i in range(self._len__points())])
113797
def summary(args):
    
    p = OptionParser(summary.__doc__)
    p.set_table(sep="|", align=True)
    p.set_outfile()
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    inputbed, scaffolds = args
    pf = inputbed.rsplit(".", 1)[0]
    mapbed = pf + ".bed"
    chr_agp = pf + ".chr.agp"
    sep = opts.sep
    align = opts.align
    cc = Map(mapbed)
    mapnames = cc.mapnames
    s = Sizes(scaffolds)
    total, l50, n50 = s.summary
    r = {}
    maps = []

    fw = must_open(opts.outfile, "w")
    print("*** Summary for each individual map ***", file=fw)
    for mapname in mapnames:
        markers = [x for x in cc if x.mapname == mapname]
        ms = MapSummary(markers, l50, s)
        r["Linkage Groups", mapname] = ms.num_lgs
        ms.export_table(r, mapname, total)
        maps.append(ms)
    print(tabulate(r, sep=sep, align=align), file=fw)

    r = {}
    agp = AGP(chr_agp)
    print("*** Summary for consensus map ***", file=fw)
    consensus_scaffolds = set(x.component_id for x in agp if not x.is_gap)
    oriented_scaffolds = set(x.component_id for x in agp \
                            if (not x.is_gap) and x.orientation != '?')
    unplaced_scaffolds = set(s.mapping.keys()) - consensus_scaffolds

    for mapname, sc in (("Anchored", consensus_scaffolds),
                    ("Oriented", oriented_scaffolds),
                    ("Unplaced", unplaced_scaffolds)):
        markers = [x for x in cc if x.seqid in sc]
        ms = MapSummary(markers, l50, s, scaffolds=sc)
        ms.export_table(r, mapname, total)
    print(tabulate(r, sep=sep, align=align), file=fw)