Utility function to return a list of patient ids in the Cohort
437052
def _list_patient_ids(self):
        
        results = []
        for patient in self:
            results.append(patient.id)
        return(results)
944828
def getIndicesFromInstId(self, instId):
        """"""
        if instId in self._idToIdxCache:
            return self._idToIdxCache[instId]

        indices = []
        for impliedFlag, modName, symName in self._indexNames:
            mibObj, = mibBuilder.importSymbols(modName, symName)
            try:
                syntax, instId = self.oidToValue(mibObj.syntax, instId, impliedFlag, indices)
            except PyAsn1Error as exc:
                debug.logger & debug.FLAG_INS and debug.logger(
                    'error resolving table indices at %s, %s: %s' % (self.__class__.__name__, instId, exc))
                indices = [instId]
                instId = ()
                break

            indices.append(syntax)  # to avoid cyclic refs

        if instId:
            raise error.SmiError(
                'Excessive instance identifier sub-OIDs left at %s: %s' %
                (self, instId)
            )

        indices = tuple(indices)
        self._idToIdxCache[instId] = indices

        return indices
286868
def ids(self):
        
        if self._ids is None:
            if self._columns:
                if isinstance(self._columns, OrderedDict):
                    return [list(self._columns.keys())[0]]
                return [self._columns[0]]
        else:
            return self._ids
296707
def get_all(self, uids: Iterable[int]) -> Mapping[int, Record]:
        
        return {uid: self._records[uid] for uid in uids
                if uid in self._records}
717019
function registrationIds() {
			const ids = [];
			for (const regid of findChildren(sapFioriAppData, "registrationId")) {
				ids.push(regid._);
			}
			return ids.length > 0 ? ids : undefined;
		}
624760
def select_data(self, iteration_indices):
        """"""
        dat = self
        iteridx = iteration_indices
        dat.f = dat.f[np.where([x in iteridx for x in dat.f[:, 0]])[0], :]
        dat.D = dat.D[np.where([x in iteridx for x in dat.D[:, 0]])[0], :]
        try:
            iteridx = list(iteridx)
            iteridx.append(iteridx[-1])  # last entry is artificial
        except:
            pass
        dat.std = dat.std[np.where([x in iteridx
                                    for x in dat.std[:, 0]])[0], :]
        dat.xmean = dat.xmean[np.where([x in iteridx
                                        for x in dat.xmean[:, 0]])[0], :]
        try:
            dat.xrecent = dat.x[np.where([x in iteridx for x in
                                          dat.xrecent[:, 0]])[0], :]
        except AttributeError:
            pass
        try:
            dat.corrspec = dat.x[np.where([x in iteridx for x in
                                           dat.corrspec[:, 0]])[0], :]
        except AttributeError:
            pass
1090612
def read_since_ids(users):
    
    since_ids = {}
    for user in users:
        if config.has_option(SECTIONS['INCREMENTS'], user):
            since_ids[user] = config.getint(SECTIONS['INCREMENTS'], user) + 1
    return since_ids
553103
def _get_selected_ids(self):
        """"""
        selection = self.get_selection()
        if selection.get_mode() != gtk.SELECTION_MULTIPLE:
            raise AttributeError('selected_ids only valid for select_multiple')
        model, selected_paths = selection.get_selected_rows()
        if selected_paths:
            return zip(*selected_paths)[0]
        else:
            return ()
932209
function getAggregatedHealthData() {
        var healthData = getStoredHealthData();
        $.extend(healthData, PerfUtils.getHealthReport());
        $.extend(healthData, FindUtils.getHealthReport());
        return healthData;
    }
1320219
def fetch(self, is_dl_forced=True):
        

        username = config.get_config()['dbauth']['udp']['user']
        password = config.get_config()['dbauth']['udp']['password']

        credentials = (username, password)

        # Get patient map file:
        patient_id_map = self.open_and_parse_yaml(self.map_files['patient_ids'])
        udp_internal_ids = patient_id_map.keys()

        phenotype_fields = ['Patient', 'HPID', 'Present']

        # Get phenotype ids for each patient
        phenotype_params = {
            'method': 'search_subjects',
            'subject_type': 'Phenotype',
            'search_mode': 'DEEP',
            'fields': 'Patient',
            'conditions': 'equals',
            'values': ','.join(udp_internal_ids),
            'user_fields': ','.join(phenotype_fields)
        }

        prioritized_variants = [
            'Patient', 'Gene', 'Chromosome Position', 'Variant Allele', 'Transcript']

        prioritized_params = {
            'method': 'search_subjects',
            'subject_type': 'Variant Prioritization',
            'search_mode': 'DEEP',
            'fields': 'Patient',
            'conditions': 'equals',
            'values': ','.join(udp_internal_ids),
            'user_fields': ','.join(prioritized_variants),
            'format': 'json'}

        variant_fields = [
            'Patient', 'Family', 'Chr', 'Build', 'Chromosome Position',
            'Reference Allele', 'Variant Allele', 'Parent of origin',
            'Allele Type', 'Mutation Type', 'Gene', 'Transcript', 'Original Amino Acid',
            'Variant Amino Acid', 'Amino Acid Change', 'Segregates with',
            'Position', 'Exon', 'Inheritance model', 'Zygosity', 'dbSNP ID',
            '1K Frequency', 'Number of Alleles']

        variant_params = {
            'method': 'search_subjects',
            'subject_type': 'Exome Analysis Results',
            'search_mode': 'DEEP',
            'fields': 'Patient',
            'conditions': 'equals',
            'user_fields': ','.join(variant_fields),
            'format': 'json'}

        pheno_file = open(
            '/'.join((self.rawdir, self.files['patient_phenotypes']['file'])), 'w')
        variant_file = open(
            '/'.join((self.rawdir, self.files['patient_variants']['file'])), 'w')

        pheno_file.write('{0}\n'.format('\t'.join(phenotype_fields)))
        variant_file.write('{0}\n'.format('\t'.join(variant_fields)))

        variant_gene = self._fetch_data_from_udp(
            udp_internal_ids, prioritized_params, prioritized_variants, credentials)

        variant_gene_map = dict()
        for line in variant_gene:
            variant_gene_map.setdefault(line[0], []).append(
                # Try to make a unique value based on gene-pos-variantAlele-transcript
                # TODO make this a dict for readability purposes
                "{0}-{1}-{2}-{3}".format(line[1], line[2], line[3], line[4]))

        variant_info = self._fetch_data_from_udp(
            udp_internal_ids, variant_params, variant_fields, credentials)

        for line in variant_info:
            variant = "{0}-{1}-{2}-{3}".format(line[10], line[4], line[6], line[11])
            if variant in variant_gene_map[line[0]]:
                line[0] = patient_id_map[line[0]]
                line[4] = re.sub(r'\.0$', '', line[4])
                variant_file.write('{0}\n'.format('\t'.join(line)))

        phenotype_info = self._fetch_data_from_udp(
            udp_internal_ids, phenotype_params, phenotype_fields, credentials)

        for line in phenotype_info:
            line[0] = patient_id_map[line[0]]
            pheno_file.write('{0}\n'.format('\t'.join(line)))

        variant_file.close()
        pheno_file.close()

        return
674578
def reference_id(self, index):
        """"""
        # TODO Include ISBN and ISSN?
        doi = self.reference_doi(index)
        if doi:
            return doi
        else:
            pmid = self.reference_pmid(index)
            if pmid:
                return "PMID_" + pmid
            else:
                unpublished_id = self.reference_unpublished_id(index)
                if unpublished_id:
                    return "UNPUBLISHED_" + unpublished_id
        return ""
762211
def _magic_json(self, action='', user_id='', app_name='', patient_id='',
                    token='', parameter1='', parameter2='',
                    parameter3='', parameter4='', parameter5='',
                    parameter6='', data=''):
        
        if not token:
            token = self._token.token
        if not app_name:
            app_name = self._app_name
        if not user_id:
            if self._ehr_username:
                user_id = self._ehr_username

        return {
            'Action': action,
            'AppUserID': user_id,
            'Appname': app_name,
            'PatientID': patient_id,
            'Token': token,
            'Parameter1': parameter1,
            'Parameter2': parameter2,
            'Parameter3': parameter3,
            'Parameter4': parameter4,
            'Parameter5': parameter5,
            'Parameter6': parameter6,
            'Data': data
        }
1207366
def list_job_ids(self, skip=0, limit=20):
        

        return [str(x["_id"]) for x in self.collection.find(
            {"status": "queued"},
            sort=[("_id", -1 if self.is_reverse else 1)],
            projection={"_id": 1})
        ]
660073
def gene_list(self, list_id):
        """"""
        return self.query(GeneList).filter_by(list_id=list_id).first()
680457
function getProvidersForLanguageId(languageId) {
        var result = [];
        if (_providers[languageId]) {
            result = result.concat(_providers[languageId]);
        }
        if (_providers['*']) {
            result = result.concat(_providers['*']);
        }
        return result;
    }
933470
def user_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = {}
    for user in kstone.users.list():
        ret[user.name] = dict((value, getattr(user, value, None)) for value in dir(user)
                              if not value.startswith('_') and
                              isinstance(getattr(user, value, None), (six.string_types, dict, bool)))
        tenant_id = getattr(user, 'tenantId', None)
        if tenant_id:
            ret[user.name]['tenant_id'] = tenant_id
    return ret
294101
def get_user_lists(self, course, classroomid):
        
        tutor_list = course.get_staff()

        # Determine if user is grouped or not in the classroom
        student_list = list(self.database.classrooms.aggregate([
            {"$match": {"_id": ObjectId(classroomid)}},
            {"$unwind": "$students"},
            {"$project": {
                "students": 1,
                "grouped": {
                    "$anyElementTrue": {
                        "$map": {
                            "input": "$groups.students",
                            "as": "group",
                            "in": {
                                "$anyElementTrue": {
                                    "$map": {
                                        "input": "$$group",
                                        "as": "groupmember",
                                        "in": {"$eq": ["$$groupmember", "$students"]}
                                    }
                                }
                            }
                        }
                    }
                }
            }}
        ]))

        student_list = dict([(student["students"], student) for student in student_list])

        other_students = [entry['students'] for entry in list(self.database.classrooms.aggregate([
            {"$match": {"courseid": course.get_id(), "_id": {"$ne": ObjectId(classroomid)}}},
            {"$unwind": "$students"},
            {"$project": {"_id": 0, "students": 1}}
        ]))]

        users_info = self.user_manager.get_users_info(other_students + list(student_list.keys()) + tutor_list)

        # Order the non-registered students
        other_students = sorted(other_students, key=lambda val: (("0"+users_info[val][0]) if users_info[val] else ("1"+val)))

        return student_list, tutor_list, other_students, users_info