Get the terms in the study group
349210
def get_terms(desc, geneset, assoc, obo_dag, log):
    
    _chk_gene2go(assoc)
    term2itemids = defaultdict(set)
    genes = [g for g in geneset if g in assoc]
    for gene in genes:
        for goid in assoc[gene]:
            if goid in obo_dag:
                term2itemids[obo_dag[goid].id].add(gene)
    if log is not None:
        num_stu = len(genes)
        num_pop = len(geneset)
        perc = 100.0*num_stu/num_pop if num_pop != 0 else 0.0
        log.write("{P:3.0f}% {N:>6,} of {M:>6,} {DESC} items found in association\n".format(
            DESC=desc, N=num_stu, M=num_pop, P=perc))
    return term2itemids
1107053
def terms(self):
        """"""
        terms = PropertyTerms(
            self.name,
            self.__class__,
            self._args,
            self._kwargs,
            self.meta
        )
        return terms
240102
def get_members_of_group(self, gname):
        
        hostgroup = self.find_by_name(gname)
        if hostgroup:
            return hostgroup.get_services()
        return []
419364
def map_tokens_to_terms(self,list_tokens):
        
        if self.terms_for_token is None:
            self.terms_for_token = {}
            for term in self.get_terms():
                termid = term.get_id()
                token_ids = term.get_span().get_span_ids()
                for tokid in token_ids:
                    if tokid not in self.terms_for_token:
                        self.terms_for_token[tokid] = [termid]
                    else:
                        self.terms_for_token[tokid].append(termid)

        ret = set()
        for my_id in list_tokens:
            term_ids = self.terms_for_token.get(my_id,[])
            ret |= set(term_ids)
        return sorted(list(ret))
342055
public function terms()
    {
        $result = array();

        /**
 * Zend_Search_Lucene_Index_TermsPriorityQueue 
*/
        include_once 'Zend/Search/Lucene/Index/TermsPriorityQueue.php';

        $segmentInfoQueue = new Zend_Search_Lucene_Index_TermsPriorityQueue();

        foreach ($this->_segmentInfos as $segmentInfo) {
            $segmentInfo->resetTermsStream();

            // Skip "empty" segments
            if ($segmentInfo->currentTerm() !== null) {
                $segmentInfoQueue->put($segmentInfo);
            }
        }

        while (($segmentInfo = $segmentInfoQueue->pop()) !== null) {
            if ($segmentInfoQueue->top() === null 
                || $segmentInfoQueue->top()->currentTerm()->key() !=                $segmentInfo->currentTerm()->key()
            ) {
                // We got new term
                $result[] = $segmentInfo->currentTerm();
            }

            if ($segmentInfo->nextTerm() !== null) {
                // Put segment back into the priority queue
                $segmentInfoQueue->put($segmentInfo);
            }
        }

        return $result;
    }
695231
def _output_terms(self):
        
        terms = list(six.itervalues(self._columns))
        screen = self.screen
        if screen is not None:
            terms.append(screen)
        return terms
43955
def _or_join(self, terms):
        

        if isinstance(terms, (tuple, list)):
            if len(terms) > 1:
                return '(' + ' OR '.join(terms) + ')'
            else:
                return terms[0]
        else:
            return terms
534993
def getent(refresh=False):
    '''
    
    '''
    if 'group.getent' in __context__ and not refresh:
        return __context__['group.getent']

    ret = []
    for grinfo in grp.getgrall():
        ret.append(info(grinfo.gr_name))

    __context__['group.getent'] = ret
    return ret
285860
def get_docs(self, vocab):
        """"""
        for string in self.strings:
            vocab[string]
        orth_col = self.attrs.index(ORTH)
        for tokens, spaces in zip(self.tokens, self.spaces):
            words = [vocab.strings[orth] for orth in tokens[:, orth_col]]
            doc = Doc(vocab, words=words, spaces=spaces)
            doc = doc.from_array(self.attrs, tokens)
            yield doc
626472
def get_group_details(self, group):
        
        result = {}
        try:
            lgroup = self._get_group(group.name)
            lgroup = preload(lgroup, database=self._database)
        except ObjectDoesNotExist:
            return result

        for i, j in lgroup.items():
            if j is not None:
                result[i] = j

        return result
801311
def all_terms(self):
        """"""

        for s_name, s in self.sections.items():

            # Yield the section header
            if s.name != 'Root':
                yield s

            # Yield all of the rows for terms in the section
            for rterm in s:
                yield rterm
                for d in rterm.descendents:
                    yield d
486138
def groups_get_integrations(self, room_id, **kwargs):
        """"""
        return self.__call_api_get('groups.getIntegrations', roomId=room_id, kwargs=kwargs)
254665
function getGroups(done) {
  return getModels(function(m) {
    return m.collections.group.find().exec(done);
  });
}
623551
def get_course_registered_users(self, course, with_admins=True):
        

        l = [entry['students'] for entry in list(self._database.aggregations.aggregate([
            {"$match": {"courseid": course.get_id()}},
            {"$unwind": "$students"},
            {"$project": {"_id": 0, "students": 1}}
        ]))]
        if with_admins:
            return list(set(l + course.get_staff()))
        else:
            return l
1372548
def get_terms(self, kwargs):
        """"""

        slug = kwargs.get("slug")
        version = kwargs.get("version")

        if slug and version:
            terms = [TermsAndConditions.objects.filter(slug=slug, version_number=version).latest('date_active')]
        elif slug:
            terms = [TermsAndConditions.get_active(slug)]
        else:
            # Return a list of not agreed to terms for the current user for the list view
            terms = TermsAndConditions.get_active_terms_not_agreed_to(self.request.user)
        return terms
715455
def get_groups(self, table_name):
        
        df = self.dm[table_name]
        return list(df['group'].unique())
816915
def run_study_nts(self, study, **kws):
        """"""
        goea_results = self.run_study(study, **kws)
        return MgrNtGOEAs(goea_results).get_goea_nts_all()