Given a list of sections containing GO IDs, get a list of sections w/GO nts.
776761
def get_nts_sections(self, sections, sortby=None):
        """"""
        goids = self.get_goids_sections(sections)
        gosubdag = GoSubDag(goids, self.go2obj)
        return [(sec, gosubdag.get_nts(gos, sortby)) for sec, gos in sections]
1161537
def get_sections_2dnt(self, sec2d_go):
        """"""
        return [(nm, self.get_ntgos_sorted(gos)) for nm, gos in sec2d_go]
121092
def get_sections(need_info):
    """"""
    sections = []
    current_node = need_info['target_node']
    while current_node:
        if isinstance(current_node, nodes.section):
            title = current_node.children[0].astext()
            # If using auto-section numbering, then Sphinx inserts
            # multiple non-breaking space unicode characters into the title
            # we'll replace those with a simple space to make them easier to
            # use in filters
            title = NON_BREAKING_SPACE.sub(' ', title)
            sections.append(title)
        current_node = getattr(current_node, 'parent', None)
    return sections
957661
def _get_goid2dbids(associations):
        """"""
        go2ids = cx.defaultdict(set)
        for ntd in associations:
            go2ids[ntd.GO_ID].add(ntd.DB_ID)
        return dict(go2ids)
77987
def leaf_sections(h):
    
    leaves = []
    for section in h.allsec():
        sref = h.SectionRef(sec=section)
        # nchild returns a float... cast to bool
        if sref.nchild() < 0.9:
            leaves.append(section)
    return leaves
383762
def _parse_sections(morph_fd):
    '''
    '''
    sections = []
    token_iter = _get_tokens(morph_fd)
    for token in token_iter:
        if token == '(':  # find top-level sections
            section = _parse_section(token_iter)
            if not _match_section(section, UNWANTED_SECTIONS):
                sections.append(section)
    return sections
855128
def get_section_hdrgos(self):
        """"""
        return set([h for _, hs in self.sections for h in hs]) if self.sections else set()
957183
def get_ns2goids(self, goids):
        """"""
        ns2goids = cx.defaultdict(set)
        go2nt = self.go2nt
        for goid in goids:
            ns2goids[go2nt[goid].NS].add(goid)
        return {ns:gos for ns, gos in ns2goids.items()}
1262262
def filter_sections(sections):
    
    if not sections:
        return None
    jobs = []
    matchers = python_version_matchers()
    for name, options in sections:
        target_version = options.pop('python', None)
        if target_version in matchers:
            jobs.append((name, options))
    return jobs
178132
def get_sections_2d_nts(self, sortby=None):
        """"""
        sections_2d_nts = []
        for section_name, hdrgos_actual in self.get_sections_2d():
            hdrgo_nts = self.gosubdag.get_nts(hdrgos_actual, sortby=sortby)
            sections_2d_nts.append((section_name, hdrgo_nts))
        return sections_2d_nts
1265852
def get_sections(self, hdrgo, dflt_section=True):
        """"""
        dflt_list = []
        # If the hdrgo is not in a section, return the default name for a section
        if dflt_section:
            dflt_list = [self.secdflt]
        return self.hdrgo2sections.get(hdrgo, dflt_list)
779970
def get_go2nt(self, goids):
        """"""
        get_nt = self.go2nt
        goids_present = set(goids).intersection(self.go2obj)
        if len(goids_present) != len(goids):
            print("GO IDs NOT FOUND IN DAG: {GOs}".format(
                GOs=" ".join(set(goids).difference(goids_present))))
        return {g:get_nt[g] for g in goids_present}
1143886
def get_go_ntsets(self, go_fins):
        """"""
        nts = []
        ntobj = namedtuple('NtGOFiles', 'hdr go_set, go_fin')
        go_sets = self._init_go_sets(go_fins)
        hdrs = [os.path.splitext(os.path.basename(f))[0] for f in go_fins]
        assert len(go_fins) == len(go_sets)
        assert len(go_fins) == len(hdrs)
        for hdr, go_set, go_fin in zip(hdrs, go_sets, go_fins):
            nts.append(ntobj(hdr=hdr, go_set=go_set, go_fin=go_fin))
        return nts
1354593
function getSections(sections, config, parentDepth) {
	return sections.map(section => processSection(section, config, parentDepth))
}
481282
def _chk_sections(sections):
        """"""
        if sections:
            assert len(sections[0]) == 2, \
                "SECTIONS DATA MUST BE A 2-D LIST. FOUND: {S}".format(S=sections)
            for _, hdrgos in sections:
                chk_goids(hdrgos, "HdrgosSections::_chk_sections()")
712952
def get_keys(self):
        
        keys = []
        for section in self.get_sections():
            phase = self._sections[section]
            for obj in phase:
                keys += obj.get_id()
        keys.sort()
        return keys
1313155
def get_section_hdrgos_nts(self, sortby=None):
        """"""
        nts_all = []
        section_hdrgos_actual = self.get_sections_2d()
        flds_all = ['Section'] + self.gosubdag.prt_attr['flds']
        ntobj = cx.namedtuple("NtGoSec", " ".join(flds_all))
        flds_go = None
        if sortby is None:
            sortby = lambda nt: -1*nt.dcnt
        for section_name, hdrgos_actual in section_hdrgos_actual:
            nts_sec = []
            for hdrgo_nt in self.gosubdag.get_go2nt(hdrgos_actual).values():
                if flds_go is None:
                    flds_go = hdrgo_nt._fields
                key2val = {key:val for key, val in zip(flds_go, list(hdrgo_nt))}
                key2val['Section'] = section_name
                nts_sec.append(ntobj(**key2val))
            nts_all.extend(sorted(nts_sec, key=sortby))
        return nts_all