This function takes a Pubmed ID, Pubmed Central ID, or DOI
    and use the Pubmed ID mapping
    service and looks up all other IDs from one
    of these. The IDs are returned in a dictionary.
548757
def id_lookup(paper_id, idtype=None):
    """"""
    if idtype is not None and idtype not in ('pmid', 'pmcid', 'doi'):
        raise ValueError("Invalid idtype %s; must be 'pmid', 'pmcid', "
                         "or 'doi'." % idtype)
    if paper_id.upper().startswith('PMC'):
        idtype = 'pmcid'
    # Strip off any prefix
    if paper_id.upper().startswith('PMID'):
        paper_id = paper_id[4:]
    elif paper_id.upper().startswith('DOI'):
        paper_id = paper_id[3:]
    data = {'ids': paper_id}
    if idtype is not None:
        data['idtype'] = idtype
    try:
        tree = pubmed_client.send_request(pmid_convert_url, data)
    except Exception as e:
        logger.error('Error looking up PMID in PMC: %s' % e)
        return {}
    if tree is None:
        return {}
    record = tree.find('record')
    if record is None:
        return {}
    doi = record.attrib.get('doi')
    pmid = record.attrib.get('pmid')
    pmcid = record.attrib.get('pmcid')
    ids = {'doi': doi,
           'pmid': pmid,
           'pmcid': pmcid}
    return ids
40147
def get_catalogs_by_ids(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_by_ids
        catalogs = self._get_provider_session('catalog_lookup_session').get_catalogs_by_ids(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Catalog(self._provider_manager, cat, self._runtime, self._proxy))
        return CatalogList(cat_list)
290901
def get_ids(cs):
    """"""
    records = []
    for c in cs:
        records.append({k: c[k] for k in c if k in {'names', 'labels'}})
    return records
15718
async def inspect(self, service_id: str) -> Mapping[str, Any]:
        

        response = await self.docker._query_json(
            "services/{service_id}".format(service_id=service_id), method="GET"
        )
        return response
1321108
function getIdColumns(idColumnNames, columns) {
  if (!defined(idColumnNames)) {
    return [];
  }
  return idColumnNames.map(name => getColumnWithNameIdOrIndex(name, columns));
}
913130
def get_pmid(doc_id):
    
    url_pmid = 'https://www.ebi.ac.uk/chembl/api/data/document.json'
    params = {'document_chembl_id': doc_id}
    res = requests.get(url_pmid, params=params)
    js = res.json()
    pmid = str(js['documents'][0]['pubmed_id'])
    return pmid
226142
def get_pubmed_record(pmid):
        """"""
        handle = Entrez.esummary(db="pubmed", id=pmid)
        record = Entrez.read(handle)
        return record
1230371
def find_list_of_ids(self, resource, ids, client_projection=None):
        """"""
        args = self._es_args(resource)
        return self._parse_hits(self.elastic(resource).mget(body={'ids': ids}, **args), resource)
114022
def perform_bulk_pubmed_query(self):
        
        if self.bulk_pubmed_query:
            failed_queries = []
            pmid_list = re.findall(r'(\d+)(?:[\s,]+|$)', self.bulk_pubmed_query)

            for pmid in pmid_list:
                try:
                    p, created = Publication.objects.get_or_create(pmid=pmid)
                except:
                    failed_queries.append(pmid)
                else:
                    self.publications.add(p.id)

            if failed_queries:
                failed_queries.sort(key=int)
                self.bulk_pubmed_query = 'FAILED QUERIES: {}'.format(', '.join(failed_queries))
            else:
                self.bulk_pubmed_query = ''
1194517
def lookup_handles(ids):
    
    names = set()
    for id_list in [ids[100 * i:100 * i + 100] for i in range(len(ids))]:
        if len(id_list) > 0:
            while True:
                r = twapi.request('users/lookup', {'user_id': ','.join([str(i) for i in id_list])})
                if r.status_code in [88, 130, 420, 429]:  # rate limit
                    sys.stderr.write('Sleeping off rate limit for %s: %s\n' % (str(id_list), r.text))
                    time.sleep(301)
                elif r.status_code == 200:
                    for item in r.get_iterator():
                        names.add((item['screen_name'], item['id_str']))
                    break
                else:
                    sys.stderr.write('Error: %s\nSkipping %s...\n' % (str(id_list), r.text))
                    break

    return names
76939
def individual_dict(self, ind_ids):
        """"""
        ind_dict = {ind.ind_id: ind for ind in self.individuals(ind_ids=ind_ids)}
        return ind_dict
843446
def services(self):
        """"""
        ids = [ref['id'] for ref in self['services']]
        return [Service.fetch(id) for id in ids]
1072987
def runGetRnaQuantificationSet(self, id_):
        
        compoundId = datamodel.RnaQuantificationSetCompoundId.parse(id_)
        dataset = self.getDataRepository().getDataset(compoundId.dataset_id)
        rnaQuantificationSet = dataset.getRnaQuantificationSet(id_)
        return self.runGetRequest(rnaQuantificationSet)
699906
def clean_pubmed_identifiers(pmids: Iterable[str]) -> List[str]:
    """"""
    return sorted({str(pmid).strip() for pmid in pmids})
1315631
private Map<String, ServiceEndPoint> indexById(Iterable<ServiceEndPoint> endPoints) {
        Map<String, ServiceEndPoint> map = Maps.newHashMap();
        for (ServiceEndPoint endPoint : endPoints) {
            map.put(endPoint.getId(), endPoint);
        }
        return map;
    }
447958
def _get_datasets(dataset_ids):
    

    dataset_dict = {}

    datasets = []
    if len(dataset_ids) > qry_in_threshold:
        idx = 0
        extent =qry_in_threshold
        while idx < len(dataset_ids):
            log.info("Querying %s datasets", len(dataset_ids[idx:extent]))
            rs = db.DBSession.query(Dataset).filter(Dataset.id.in_(dataset_ids[idx:extent])).all()
            datasets.extend(rs)
            idx = idx + qry_in_threshold

            if idx + qry_in_threshold > len(dataset_ids):
                extent = len(dataset_ids)
            else:
                extent = extent + qry_in_threshold
    else:
        datasets = db.DBSession.query(Dataset).filter(Dataset.id.in_(dataset_ids))


    for r in datasets:
        dataset_dict[r.id] = r

    log.info("Retrieved %s datasets", len(dataset_dict))

    return dataset_dict
932790
def get_pubmed_citation_response(pubmed_identifiers: Iterable[str]):
    
    pubmed_identifiers = list(pubmed_identifiers)
    url = EUTILS_URL_FMT.format(','.join(
        pubmed_identifier
        for pubmed_identifier in pubmed_identifiers
        if pubmed_identifier
    ))
    response = requests.get(url)
    return response.json()