Return tuples for all parent GO IDs, containing current GO ID and parent GO ID.
325986
def get_all_parent_edges(self):
        """"""
        all_parent_edges = set()
        for parent in self.parents:
            all_parent_edges.add((self.item_id, parent.item_id))
            all_parent_edges |= parent.get_all_parent_edges()
        return all_parent_edges
858127
def parents(self):
        
        return [self.repository.get_changeset(parent.rev())
                for parent in self._ctx.parents() if parent.rev() >= 0]
1026392
def get_all_parents(self):
        """"""
        all_parents = set()
        for parent in self.parents:
            all_parents.add(parent.item_id)
            all_parents |= parent.get_all_parents()
        return all_parents
644393
def parent_org_sdo_ids(self):
        ''''''
        return [sdo.get_owner()._narrow(SDOPackage.SDO).get_sdo_id() \
                for sdo in self._obj.get_organizations() if sdo]
500390
def get_grouped(self, go_ntsets, go_all, gosubdag, **kws):
        """"""
        kws_grpd = {k:v for k, v in kws.items() if k in Grouped.kws_dict}
        kws_grpd['go2nt'] = self._init_go2ntpresent(go_ntsets, go_all, gosubdag)
        return Grouped(gosubdag, self.godag.version, **kws_grpd)
1252733
def internal_get_goids_or_sections(self):
        """"""
        if self.goids_fin:
            chk_goids(self.goids_fin, "read_goids")
            return {'goids' : self.goids_fin}
        else:
            # Convert dict into 2D list retaining original section order
            sections_2d = []
            for section_name in self.sections_seen:
                if section_name in self.section2goids:
                    goids = self.section2goids.get(section_name)
                    chk_goids(goids, "GO IDs IN SECTION({S})".format(S=section_name))
                    sections_2d.append((section_name, goids))
            return {'sections' : sections_2d}
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
114638
def _init_rel2dst2srcs(self, go_sources, traverse_child):
        """"""
        if not traverse_child or not self.relationships:
            return {}
        rel2dst2srcs = {r:defaultdict(set) for r in self.relationships}
        goids_seen = set()
        go2obj = self.go2obj
        for goid_src in go_sources:
            goobj_src = go2obj[goid_src]
            if goid_src not in goids_seen:
                self._traverse_relationship_rev_objs(rel2dst2srcs, goobj_src, goids_seen)
        return rel2dst2srcs
1169600
def _init_go_sets(self, go_fins):
        """"""
        go_sets = []
        assert go_fins, "EXPECTED FILES CONTAINING GO IDs"
        assert len(go_fins) >= 2, "EXPECTED 2+ GO LISTS. FOUND: {L}".format(
            L=' '.join(go_fins))
        obj = GetGOs(self.godag)
        for fin in go_fins:
            assert os.path.exists(fin), "GO FILE({F}) DOES NOT EXIST".format(F=fin)
            go_sets.append(obj.get_usrgos(fin, sys.stdout))
        return go_sets
284356
def chk_goids(goids, msg=None, raise_except=True):
    """"""
    for goid in goids:
        if not goid_is_valid(goid):
            if raise_except:
                raise RuntimeError("BAD GO({GO}): {MSG}".format(GO=goid, MSG=msg))
            else:
                return goid
1006420
def _get_dbid2goids(associations):
        """"""
        id2gos = cx.defaultdict(set)
        for ntd in associations:
            id2gos[ntd.DB_ID].add(ntd.GO_ID)
        return dict(id2gos)
982917
def parents( self, node ):
        """"""
        if 'index' in node:
            index = node['index']()
            parents = list(meliaeloader.children( node, index, 'parents' ))
            return parents 
        return []
335015
def getAncestorsUIDs(instance):
    
    request = instance.getRequest()
    parents = map(lambda ar: api.get_uid(ar), request.getAncestors())
    return [api.get_uid(request)] + parents
314378
def rm_gos(self, rm_goids):
        """"""
        self.edges = self._rm_gos_edges(rm_goids, self.edges)
        self.edges_rel = self._rm_gos_edges_rel(rm_goids, self.edges_rel)
309199
def _traverse_child_objs(self, goobj_parent):
        """"""
        parent_id = goobj_parent.id
        # mark parent as seen
        self.seen_pids.add(parent_id)
        self.godag.go2obj[parent_id] = goobj_parent
        # Loop through children
        for child_obj in goobj_parent.children:
            child_id = child_obj.id
            self.godag.p2cs[parent_id].add(child_id)
            # If child has not been seen
            if child_id not in self.seen_pids:
                self._traverse_child_objs(child_obj)
505182
def _init_rel2src2dsts(self, go_sources, traverse_parent):
        """"""
        if not traverse_parent or not self.relationships:
            return {}
        rel2src2dsts = {r:defaultdict(set) for r in self.relationships}
        goids_seen = set()
        go2obj = self.go2obj
        for goid_src in go_sources:
            goobj_src = go2obj[goid_src]
            if goobj_src.relationship and goid_src not in goids_seen:
                self._traverse_relationship_objs(rel2src2dsts, goobj_src, goids_seen)
        return rel2src2dsts
693685
def get_go2children_go2obj(go2obj):
    """"""
    goobjs, altgo2goobj = get_goobjs_altgo2goobj(go2obj)
    go2children = get_id2children(goobjs)
    add_alt_goids(go2children, altgo2goobj)
    return go2children