Return specfied GoSubDag initialization object.
13580
def _get_edgesobj(gosubdag, **kws):
    """"""
    # Keyword args (kws):
    #     1. dst_srcs_list  Used for edges pruned such that only GO terms
    #                       are retained which are between the sets of dst & srcs.
    #     2  traverse_parent & traverse_child
    #                       Used to generate a GoSubDag with all parent terms and/or
    #                       all child terms, without pruning any paths.
    # Call function, get_edgesobj, with:
    #     get_edgesobj(go2obj, dst_srcs_list=...)
    # Or any of:
    #     get_edgesobj(go2obj, go_sources=...)
    #     get_edgesobj(go2obj, go_sources=..., traverse_parent=...,)
    #     get_edgesobj(go2obj, go_sources=..., traverse_child=...,)
    #     get_edgesobj(go2obj, go_sources=..., traverse_parent=..., traverse_child=...,)
    dst_srcs_list = kws.get('dst_srcs_list', None)
    if dst_srcs_list is not None:
        return EdgesPath(gosubdag, dst_srcs_list)
    return EdgesRelatives(gosubdag,
                          kws.get('traverse_parent', True),
                          kws.get('traverse_child', False))
47260
def _init_go2ntpresent(go_ntsets, go_all, gosubdag):
        """"""
        go2ntpresent = {}
        ntobj = namedtuple('NtPresent', " ".join(nt.hdr for nt in go_ntsets))
        # Get present marks for GO sources
        for goid_all in go_all:
            present_true = [goid_all in nt.go_set for nt in go_ntsets]
            present_str = ['X' if tf else '.' for tf in present_true]
            go2ntpresent[goid_all] = ntobj._make(present_str)
        # Get present marks for all other GO ancestors
        goids_ancestors = set(gosubdag.go2obj).difference(go2ntpresent)
        assert not goids_ancestors.intersection(go_all)
        strmark = ['.' for _ in range(len(go_ntsets))]
        for goid in goids_ancestors:
            go2ntpresent[goid] = ntobj._make(strmark)
        return go2ntpresent
644903
def initialize():
        """"""
        _WindowsCSBI._define_csbi()
        _WindowsCSBI.HANDLE_STDERR = _WindowsCSBI.HANDLE_STDERR or _WindowsCSBI.WINDLL.kernel32.GetStdHandle(-12)
        _WindowsCSBI.HANDLE_STDOUT = _WindowsCSBI.HANDLE_STDOUT or _WindowsCSBI.WINDLL.kernel32.GetStdHandle(-11)
        if _WindowsCSBI.WINDLL.kernel32.GetConsoleScreenBufferInfo.argtypes:
            return

        _WindowsCSBI.WINDLL.kernel32.GetStdHandle.argtypes = [ctypes.wintypes.DWORD]
        _WindowsCSBI.WINDLL.kernel32.GetStdHandle.restype = ctypes.wintypes.HANDLE
        _WindowsCSBI.WINDLL.kernel32.GetConsoleScreenBufferInfo.restype = ctypes.wintypes.BOOL
        _WindowsCSBI.WINDLL.kernel32.GetConsoleScreenBufferInfo.argtypes = [
            ctypes.wintypes.HANDLE, ctypes.POINTER(_WindowsCSBI.CSBI)
        ]
1079462
def _init_gos(self, go_sources_arg, relationships_arg):
        """"""
        # No GO sources provided
        if not go_sources_arg:
            assert self.go2obj_orig, "go2obj MUST BE PRESENT IF go_sources IS NOT"
            self.go_sources = set(self.go2obj_orig)
            self.go2obj = self.go2obj_orig
            sys.stdout.write("**NOTE: {N:,} SOURCE GO IDS\n".format(N=len(self.go_sources)))
            return
        # GO sources provided
        go_sources = self._init_go_sources(go_sources_arg, self.go2obj_orig)
        # Create new go2obj_user subset matching GO sources
        # Fill with source and parent GO IDs and alternate GO IDs
        go2obj_user = {}
        objrel = CurNHigher(relationships_arg, self.go2obj_orig)
        objrel.get_id2obj_cur_n_high(go2obj_user, go_sources)
        # Add additional GOTerm information, if needed for user task
        kws_gos = {k:v for k, v in self.kws.items() if k in self.kws_aux_gos}
        if kws_gos:
            self._add_goterms_kws(go2obj_user, kws_gos)
        self.go_sources = go_sources
        self.go2obj = go2obj_user
660964
def get_go2sectiontxt(self):
        """"""
        go2txt = {}
        _get_secs = self.hdrobj.get_sections
        hdrgo2sectxt = {h:" ".join(_get_secs(h)) for h in self.get_hdrgos()}
        usrgo2hdrgo = self.get_usrgo2hdrgo()
        for goid, ntgo in self.go2nt.items():
            hdrgo = ntgo.GO if ntgo.is_hdrgo else usrgo2hdrgo[ntgo.GO]
            go2txt[goid] = hdrgo2sectxt[hdrgo]
        return go2txt
978024
def _init_objcolor(self, node_opts, **kwu):
        """"""
        objgoea = node_opts.kws['dict'].get('objgoea', None)
        # kwu: go2color go2bordercolor dflt_bordercolor key2col
        return Go2Color(self.gosubdag, objgoea, **kwu)
432698
def _get_goroot(self, goids_all, namespace):
        """"""
        root_goid = self.consts.NAMESPACE2GO[namespace]
        if root_goid in goids_all:
            return root_goid
        root_goids = set()
        for goid in goids_all:
            goterm = self.gosubdag.go2obj[goid]
            if goterm.depth == 0:
                root_goids.add(goterm.id)
        if len(root_goids) == 1:
            return next(iter(root_goids))
        raise RuntimeError("UNEXPECTED NUMBER OF ROOTS: {R}".format(R=root_goids))
1104001
def _get_gosubdagplotnt(self, ntplt, title, go2color, pltargs):
        """"""
        kws_plt = pltargs.get_kws_plt()
        kws_plt['id'] = '"{ID}"'.format(ID=ntplt.hdrgo)
        kws_plt['title'] = "{TITLE} of {M} user GOs".format(TITLE=title, M=ntplt.tot_usrgos)
        kws_plt['go2color'] = go2color
        kws_plt['go2bordercolor'] = pltargs.go2bordercolor
        if ntplt.parentcnt:
            kws_plt["parentcnt"] = True
        gosubdagplot = GoSubDagPlot(ntplt.gosubdag, **kws_plt)
        return GoSubDagPlotNt(self.grprobj, gosubdagplot, ntplt)
461209
def _gorg(cls):
    """"""
    assert isinstance(cls, GenericMeta)
    if hasattr(cls, '_gorg'):
        return cls._gorg
    while cls.__origin__ is not None:
        cls = cls.__origin__
    return cls
277878
function getInitialState() {
	return {
		month: {},
		day: {},
		rangeSelection: null,
		rangeSelectionMode: RangeSelection.IDLE,
		selectedDays: [],
		selectedDaysByIndex: [],
		weekIndex: 0
	};
}
732364
def my_archieve(self):
        """"""
        if not self._ptr:
            raise BfdException("BFD not initialized")

        return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.MY_ARCHIEVE)
532701
def _init(self):
        """"""
        for goid in self.godag.go_sources:
            goobj = self.godag.go2obj[goid]
            self.godag.go2obj[goid] = goobj
            # Traverse up parents
            if self.traverse_parent and goid not in self.seen_cids:
                self._traverse_parent_objs(goobj)
            # Traverse down children
            if self.traverse_child and goid not in self.seen_pids:
                self._traverse_child_objs(goobj)
819929
def _init_kws(self):
        """"""
        # Return user-specified GO formatting, if specfied:
        if 'fmtgo' not in self.kws:
            self.kws['fmtgo'] = self.grprdflt.gosubdag.prt_attr['fmt'] + "\n"
        if 'fmtgo2' not in self.kws:
            self.kws['fmtgo2'] = self.grprdflt.gosubdag.prt_attr['fmt'] + "\n"
        if 'fmtgene' not in self.kws:
            if 'itemid2name' not in self.kws:
                self.kws['fmtgene'] = "{AART} {ID}\n"
            else:
                self.kws['fmtgene'] = "{AART} {ID} {NAME}\n"
        if 'fmtgene2' not in self.kws:
            self.kws['fmtgene2'] = self.kws['fmtgene']
677059
def _get_goids(gostr):
        """"""
        if 'GO:' in gostr:
            return gostr.split(',')
        elif os.path.exists(gostr):
            return GetGOs().get_goids(None, gostr, sys.stdout)
1061768
def _get_sortgo(self):
        """"""
        if 'sortgo' in self.datobj.kws:
            return self.datobj.kws['sortgo']
        return self.datobj.grprdflt.gosubdag.prt_attr['sort'] + "\n"
1125544
def _init_object(self, catalog_id, proxy, runtime, cat_name, cat_class):
        """"""
        self._catalog_identifier = None
        self._init_proxy_and_runtime(proxy, runtime)
        self._catalog = cat_class(self._my_catalog_map)
        self._catalog._authority = self._authority  # there should be a better way...
        self._catalog_id = self._catalog.get_id()
        self._forms = dict()
552343
def _init_c2ps(self, go_sources, traverse_child):
        """"""
        if not traverse_child:
            return {}
        c2ps = defaultdict(set)
        goids_seen = set()
        go2obj = self.go2obj
        for goid_src in go_sources:
            goobj_src = go2obj[goid_src]
            if goid_src not in goids_seen:
                ##F self._traverse_child_objs(c2ps, goobj_src, go2obj, goids_seen)
                self._traverse_child_objs(c2ps, goobj_src, goids_seen)
        return c2ps