Return a go2obj dict for just the user goids.
510774
def get_vals(self, field, goids=None):
        """"""
        go2nt = self.go2nt
        if goids is None:
            goids = set(go2nt)
        return [getattr(go2nt[go], field) for go in goids]
1365834
def get_user(
        self, identified_with, identifier, req, resp, resource, uri_kwargs
    ):
        """"""
        return self.user
471732
def get_go2color_users(self,
                           usrgo_color='#feffa3', # yellow
                           hdrusrgo_color='#d4ffea', # green
                           hdrgo_color='#eee6f6'): # purple
        """"""
        go2color = {}
        # Color user GO IDs
        for goid in self.usrgos:
            go2color[goid] = usrgo_color
        # Color header GO IDs. Headers which are also GO IDs get their own color.
        for goid_hdr in self.hdrgos_actual:
            go2color[goid_hdr] = hdrusrgo_color if goid_hdr in self.usrgos else hdrgo_color
        return go2color
225125
def _traverse_parent_objs(self, p2cs, goobj_child, goids_seen):
        """"""
        # Update public(go2obj p2cs), private(goids_seen)
        child_id = goobj_child.id
        # mark child as seen
        goids_seen.add(child_id)
        ##A self.go2obj[child_id] = goobj_child
        # Update goids_seen and go2obj with child alt_ids
        for goid_altid in goobj_child.alt_ids:
            goids_seen.add(goid_altid)
            ##A self.go2obj[goid_altid] = goobj_child
        # Loop through parents of child object
        for parent_obj in goobj_child.parents:
            parent_id = parent_obj.id
            p2cs[parent_id].add(child_id)
            # If parent has not been seen, traverse
            if parent_id not in goids_seen:
                ##F self._traverse_parent_objs(p2cs, parent_obj, go2obj, goids_seen)
                self._traverse_parent_objs(p2cs, parent_obj, goids_seen)
140079
def get_user(self, idvalue, options=None):
        
        options = options or {}
        data = options.copy()
        data['id'] = idvalue
        return self.api_get('user', data)
1093731
def _get_go2pydotnode(self):
        """"""
        go2node = {}
        for goid, goobj in self.godag.go2obj.items():
            txt = self._get_node_text(goid, goobj)
            fillcolor = self.goid2color.get(goid, "white")
            node = self.pydot.Node(
                txt,
                shape="box",
                style="rounded, filled",
                fillcolor=fillcolor,
                color="mediumseagreen")
            go2node[goid] = node
        return go2node
1138534
def user(self, extra_params=None):
        
        if self.get('assigned_to_id', None):
            users = self.space.users(
                id=self['assigned_to_id'],
                extra_params=extra_params
            )
            if users:
                return users[0]
1112864
def _get_user(self, user):
        """"""
        return ' '.join([user.username, user.first_name, user.last_name])
622953
def _init_go_sources(self, go_sources_arg, go2obj_arg):
        """"""
        gos_user = set(go_sources_arg)
        if 'children' in self.kws and self.kws['children']:
            gos_user |= get_leaf_children(gos_user, go2obj_arg)
        gos_godag = set(go2obj_arg)
        gos_source = gos_user.intersection(gos_godag)
        gos_missing = gos_user.difference(gos_godag)
        if not gos_missing:
            return gos_source
        sys.stdout.write("{N} GO IDs NOT FOUND IN GO DAG: {GOs}\n".format(
            N=len(gos_missing), GOs=" ".join([str(e) for e in gos_missing])))
        return gos_source
1220311
def fetch_userid(self, side):
        """"""
        for user in self.users:
            obj = self.users[user]
            if obj.side == side:
                return user
685176
def _get_id2obj_high(self, id2obj_user, id_sources, fnc_fill):
        """"""
        for idid_user in id_sources:
            idobj_user = self.id2obj_all[idid_user]
            fnc_fill(id2obj_user, idobj_user)
            id2obj_user[idobj_user.item_id] = idobj_user
            if idid_user != idobj_user.item_id:
                id2obj_user[idid_user] = idobj_user
570916
def user(session, uid, ladder_ids=None):
    """"""
    data = get_user(session, uid)
    resp = dict(data)
    if not ladder_ids:
        return resp
    resp['ladders'] = {}
    for ladder_id in ladder_ids:
        if isinstance(ladder_id, str):
            ladder_id = lookup_ladder_id(ladder_id)
        try:
            ladder_data = dict(get_ladder(session, ladder_id, user_id=uid))
            resp['ladders'][ladder_id] = ladder_data
        except VooblyError:
            # No ranking on ladder
            pass
    return resp
1006420
def _get_dbid2goids(associations):
        """"""
        id2gos = cx.defaultdict(set)
        for ntd in associations:
            id2gos[ntd.DB_ID].add(ntd.GO_ID)
        return dict(id2gos)
141965
def get_go2obj_unique(go2obj):
    """"""
    # Find the unique GO Terms that are represented for each GO in go2obj
    goid2gokeys = cx.defaultdict(set)
    for goid, goobj in go2obj.items():
        goid2gokeys[goobj.id].add(goid)
    go_unique = set()
    for goid, gos_seen in goid2gokeys.items():
        # Return main GO ID, if it is present in the go2obj keys
        if goid in gos_seen:
            go_unique.add(goid)
        # Otherwise return an alternate GO ID
        else:
            go_unique.add(next(iter(gos_seen)))
    return go_unique
865124
def get_depth2goobjs(go2obj, max_depth=2):
        """"""
        depth2goobjs = {d:list() for d in range(max_depth+1)}
        goid_seen = set()
        for _, goobj in sorted(go2obj.items(), key=lambda t: t[1].depth):
            # Save depth-00, depth-01, depth-02
            if goobj.depth > max_depth:
                break
            goid = goobj.id
            if not goobj.is_obsolete and goid not in goid_seen:
                depth2goobjs[goobj.depth].append(goobj)
                goid_seen.add(goid)
        return depth2goobjs
822386
def get_by_id(self, id):
        """"""
        user = super(ExtendedUsersService, self).get_by_id(id)
        user.first_name = 'John' + str(id)
        user.last_name = 'Smith' + str(id)
        user.gender = 'male'
        return user
937156
def get_user_by_id(self, id):
        """"""
        return self.db_adapter.get_object(self.UserClass, id=id)