Obtain the CAS ID Mapping.
179497
private static Map<Elements, String> initCasIds() {
        Map<Elements, String> ids = new EnumMap<Elements, String>(Elements.class);
        ids.put(Unknown, "");
        ids.put(Hydrogen, "1333-74-0");
        ids.put(Helium, "7440-59-7");
        ids.put(Lithium, "7439-93-2");
        ids.put(Beryllium, "7440-41-7");
        ids.put(Boron, "7440-42-8");
        ids.put(Carbon, "7440-44-0");
        ids.put(Nitrogen, "7727-37-9");
        ids.put(Oxygen, "7782-44-7");
        ids.put(Fluorine, "7782-41-4");
        ids.put(Neon, "7440-01-9");
        ids.put(Sodium, "7440-23-5");
        ids.put(Magnesium, "7439-95-4");
        ids.put(Aluminium, "7429-90-5");
        ids.put(Silicon, "7440-21-3");
        ids.put(Phosphorus, "7723-14-0");
        ids.put(Sulfur, "7704-34-9");
        ids.put(Chlorine, "7782-50-5");
        ids.put(Argon, "7440-37-1");
        ids.put(Potassium, "7440-09-7");
        ids.put(Calcium, "7440-70-2");
        ids.put(Scandium, "7440-20-2");
        ids.put(Titanium, "7440-32-6");
        ids.put(Vanadium, "7440-62-2");
        ids.put(Chromium, "7440-47-3");
        ids.put(Manganese, "7439-96-5");
        ids.put(Iron, "7439-89-6");
        ids.put(Cobalt, "7440-48-4");
        ids.put(Nickel, "7440-02-0");
        ids.put(Copper, "7440-50-8");
        ids.put(Zinc, "7440-66-6");
        ids.put(Gallium, "7440-55-3");
        ids.put(Germanium, "7440-56-4");
        ids.put(Arsenic, "7440-38-2");
        ids.put(Selenium, "7782-49-2");
        ids.put(Bromine, "7726-95-6");
        ids.put(Krypton, "7439-90-9");
        ids.put(Rubidium, "7440-17-7");
        ids.put(Strontium, "7440-24-6");
        ids.put(Yttrium, "7440-65-5");
        ids.put(Zirconium, "7440-67-7");
        ids.put(Niobium, "7440-03-1");
        ids.put(Molybdenum, "7439-98-7");
        ids.put(Technetium, "7440-26-8");
        ids.put(Ruthenium, "7440-18-8");
        ids.put(Rhodium, "7440-16-6");
        ids.put(Palladium, "7440-05-3");
        ids.put(Silver, "7440-22-4");
        ids.put(Cadmium, "7440-43-9");
        ids.put(Indium, "7440-74-6");
        ids.put(Tin, "7440-31-5");
        ids.put(Antimony, "7440-36-0");
        ids.put(Tellurium, "13494-80-9");
        ids.put(Iodine, "7553-56-2");
        ids.put(Xenon, "7440-63-3");
        ids.put(Caesium, "7440-46-2");
        ids.put(Barium, "7440-39-3");
        ids.put(Lanthanum, "7439-91-0");
        ids.put(Cerium, "7440-45-1");
        ids.put(Praseodymium, "7440-10-0");
        ids.put(Neodymium, "7440-00-8");
        ids.put(Promethium, "7440-12-2");
        ids.put(Samarium, "7440-19-9");
        ids.put(Europium, "7440-53-1");
        ids.put(Gadolinium, "7440-54-2");
        ids.put(Terbium, "7440-27-9");
        ids.put(Dysprosium, "7429-91-6");
        ids.put(Holmium, "7440-60-0");
        ids.put(Erbium, "7440-52-0");
        ids.put(Thulium, "7440-30-4");
        ids.put(Ytterbium, "7440-64-4");
        ids.put(Lutetium, "7439-94-3");
        ids.put(Hafnium, "7440-58-6");
        ids.put(Tantalum, "7440-25-7");
        ids.put(Tungsten, "7440-33-7");
        ids.put(Rhenium, "7440-15-5");
        ids.put(Osmium, "7440-04-2");
        ids.put(Iridium, "7439-88-5");
        ids.put(Platinum, "7440-06-4");
        ids.put(Gold, "7440-57-5");
        ids.put(Mercury, "7439-97-6");
        ids.put(Thallium, "7440-28-0");
        ids.put(Lead, "7439-92-1");
        ids.put(Bismuth, "7440-69-9");
        ids.put(Polonium, "7440-08-6");
        ids.put(Astatine, "7440-08-6");
        ids.put(Radon, "10043-92-2");
        ids.put(Francium, "7440-73-5");
        ids.put(Radium, "7440-14-4");
        ids.put(Actinium, "7440-34-8");
        ids.put(Thorium, "7440-29-1");
        ids.put(Protactinium, "7440-13-3");
        ids.put(Uranium, "7440-61-1");
        ids.put(Neptunium, "7439-99-8");
        ids.put(Plutonium, "7440-07-5");
        ids.put(Americium, "7440-35-9");
        ids.put(Curium, "7440-51-9");
        ids.put(Berkelium, "7440-40-6");
        ids.put(Californium, "7440-71-3");
        ids.put(Einsteinium, "7429-92-7");
        ids.put(Fermium, "7440-72-4");
        ids.put(Mendelevium, "7440-11-1");
        ids.put(Nobelium, "10028-14-5");
        ids.put(Lawrencium, "22537-19-5");
        ids.put(Rutherfordium, "53850-36-5");
        ids.put(Dubnium, "53850-35-4");
        ids.put(Seaborgium, "54038-81-2");
        ids.put(Bohrium, "54037-14-8");
        ids.put(Hassium, "54037-57-9");
        ids.put(Meitnerium, "54038-01-6");
        ids.put(Darmstadtium, "54083-77-1");
        ids.put(Roentgenium, "54386-24-2");
        ids.put(Copernicium, "54084-26-3");
        ids.put(Ununtrium, "");
        ids.put(Flerovium, "54085-16-4");
        ids.put(Ununpentium, "");
        ids.put(Livermorium, "54100-71-9");
        ids.put(Ununseptium, "");
        ids.put(Ununoctium, "");
        return ids;
    }
1337396
def get_id2gos(self, **kws):
        """"""
        return self._get_id2gos(self.associations, **kws) if kws else self.id2gos
334450
def get_residue_mapping(self):
        """"""

        resid_list = self.aa_resids()
        # resid_set  = set(resid_list)
        # resid_lst1 = list(resid_set)
        # resid_lst1.sort()
        map_res_id = {}

        x = 1
        for resid in resid_list:
            # map_res_id[ int(resid[1:].strip()) ] = x
            map_res_id[ resid ] = x
            x+=1
        return map_res_id
1067700
private FieldDescriptor extractIdentityColumnField(ClassDescriptor cld)
    {
        FieldDescriptor[] pkFields = cld.getPkFields();
        for(int i = 0; i < pkFields.length; i++)
        {
            // to find the identity column we search for a autoincrement
            // read-only field
            if(pkFields[i].isAutoIncrement() && pkFields[i].isAccessReadOnly())
            {
                return pkFields[i];
            }
        }
        return null;
    }
766346
def get_id2gos_all(taxid2asscs_a2b):
        """"""
        id2gos_all = {}
        for a2b in taxid2asscs_a2b.values():
            for geneid, gos in a2b['ID2GOs'].items():
                id2gos_all[geneid] = gos
        return id2gos_all
286729
def _pid_to_id(self, pid):
        """"""
        return d1_common.url.joinPathElements(
            self._base_url,
            self._version_tag,
            "resolve",
            d1_common.url.encodePathElement(pid),
        )
956567
def get_symbol_id_map(self):
        

        symbol_id_map = {}
        f = '/'.join((self.rawdir, self.files['genes']['file']))
        with open(f, 'r', encoding="utf8") as csvfile:
            filereader = csv.reader(csvfile, delimiter='\t', quotechar='\"')
            for row in filereader:
                (hgnc_id, symbol, name, locus_group, locus_type, status,
                 location, location_sortable, alias_symbol, alias_name,
                 prev_symbol, prev_name, gene_family, gene_family_id,
                 date_approved_reserved, date_symbol_changed,
                 date_name_changed, date_modified, entrez_id, ensembl_gene_id,
                 vega_id, ucsc_id, ena, refseq_accession, ccds_id, uniprot_ids,
                 pubmed_id, mgd_id, rgd_id, lsdb, cosmic, omim_id, mirbase,
                 homeodb, snornabase, bioparadigms_slc, orphanet,
                 pseudogene_org, horde_id, merops, imgt, iuphar,
                 kznf_gene_catalog, mamit_trnadb, cd, lncrnadb, enzyme_id,
                 intermediate_filament_db) = row

                symbol_id_map[symbol.strip()] = hgnc_id

        return symbol_id_map
531564
def get_cas_client(service_url=None, request=None):
    
    # Handle CAS_SERVER_URL without protocol and hostname
    server_url = django_settings.CAS_SERVER_URL
    if server_url and request and server_url.startswith('/'):
        scheme = request.META.get("X-Forwarded-Proto", request.scheme)
        server_url = scheme + "://" + request.META['HTTP_HOST'] + server_url
    # assert server_url.startswith('http'), "settings.CAS_SERVER_URL invalid"

    if not django_settings.CAS_VERIFY_SSL_CERTIFICATE:
        warnings.warn(
            "`CAS_VERIFY_SSL_CERTIFICATE` is disabled, meaning that SSL certificates "
            "are not being verified by a certificate authority. This can expose your "
            "system to various attacks and should _never_ be disabled in a production "
            "environment."
        )

    return CASClient(
        service_url=service_url,
        version=django_settings.CAS_VERSION,
        server_url=server_url,
        extra_login_params=django_settings.CAS_EXTRA_LOGIN_PARAMS,
        renew=django_settings.CAS_RENEW,
        username_attribute=django_settings.CAS_USERNAME_ATTRIBUTE,
        proxy_callback=django_settings.CAS_PROXY_CALLBACK,
        verify_ssl_certificate=django_settings.CAS_VERIFY_SSL_CERTIFICATE
    )
472828
def cas!(key, ttl=nil, options=nil, &block)
      cas_core(key, true, ttl, options, &block)
    end
1119054
def _cas_2(self):
        '''  '''

        lonc_left = self._format_lon(self.lonm)
        lonc_right = self._format_lon(self.lonM)
        latc = self._format_lat(self.latm)

        print(lonc_left, lonc_right, self.lonm, self.lonM)
        img_name_left = self._format_name_map(lonc_left, latc)
        print(img_name_left)
        img_left = BinaryTable(img_name_left, self.path_pdsfiles)
        X_left, Y_left, Z_left = img_left.extract_grid(self.lonm,
                                                       float(
                                                           img_left.EASTERNMOST_LONGITUDE),
                                                       self.latm,
                                                       self.latM)

        img_name_right = self._format_name_map(lonc_right, latc)
        img_right = BinaryTable(img_name_right, self.path_pdsfiles)
        X_right, Y_right, Z_right = img_right.extract_grid(float(img_right.WESTERNMOST_LONGITUDE),
                                                           self.lonM,
                                                           self.latm,
                                                           self.latM)

        X_new = np.hstack((X_left, X_right))
        Y_new = np.hstack((Y_left, Y_right))
        Z_new = np.hstack((Z_left, Z_right))

        return X_new, Y_new, Z_new
1239431
def _get_binding_keys(self, port, host):
        """"""
        binding_keys = list()
        switch_binding = port[portbindings.PROFILE].get(
            'local_link_information', None)
        if switch_binding:
            for binding in switch_binding:
                switch_id = binding.get('switch_id')
                port_id = binding.get('port_id')
                binding_keys.append((port['id'], (switch_id, port_id)))
        else:
            binding_keys.append((port['id'], host))
        return binding_keys
39299
def get_vendor_extension_fields(mapping):
    
    return {k: v for k, v in mapping.items() if k.startswith('x-')}
191499
def lookup_ids(self, keys):
        """"""
        keys_len = len(keys)
        ids = {namespace_key: None for namespace_key in keys}
        start = 0
        bulk_insert = self.bulk_insert
        query = 'SELECT namespace, key, id FROM gauged_keys WHERE '
        check = '(namespace = %s AND key = %s) '
        cursor = self.cursor
        execute = cursor.execute
        while start < keys_len:
            rows = keys[start:start+bulk_insert]
            params = [param for params in rows for param in params]
            id_query = query + (check + ' OR ') * (len(rows) - 1) + check
            execute(id_query, params)
            for namespace, key, id_ in cursor:
                ids[(namespace, key)] = id_
            start += bulk_insert
        return ids
1119456
def get_parent_id(self):
        ''''''
        parent_id = parsers.get_parent_id(self.__chebi_id)
        return None if math.isnan(parent_id) else 'CHEBI:' + str(parent_id)
655917
def _get_mapping(parser, mapped):
    """"""
    if mapped in parser.mappings:
        return parser.mappings[mapped]
    else:
        return mapped + ".f90"
1298481
def _lookup_identity_names(self):
        
        id_batch_size = 100

        # fetch in batches of 100, store in a dict
        ac = get_auth_client()
        self._resolved_map = {}
        for i in range(0, len(self.identity_ids), id_batch_size):
            chunk = self.identity_ids[i : i + id_batch_size]
            resolved_result = ac.get_identities(ids=chunk)
            for x in resolved_result["identities"]:
                self._resolved_map[x["id"]] = x["username"]
1019199
def get_atom_mapping(self):
        """"""
        # Atom mappings
        smiles_to_pdb_mapping = self.bindingsite.xpath('mappings/smiles_to_pdb/text()')
        if smiles_to_pdb_mapping == []:
            self.mappings = {'smiles_to_pdb': None, 'pdb_to_smiles': None}
        else:
            smiles_to_pdb_mapping = {int(y[0]): int(y[1]) for y in [x.split(':')
                                                                    for x in smiles_to_pdb_mapping[0].split(',')]}
            self.mappings = {'smiles_to_pdb': smiles_to_pdb_mapping}
            self.mappings['pdb_to_smiles'] = {v: k for k, v in self.mappings['smiles_to_pdb'].items()}