Retrieve the Assay record for the specified AID.

        :param int aid: The PubChem Assay Identifier (AID).
426167
def from_aid(cls, aid):
        
        record = json.loads(request(aid, 'aid', 'assay', 'description').read().decode())['PC_AssayContainer'][0]
        return cls(record)
1186339
def command(state, args):
    """"""
    if len(args) < 2:
        print(f'Usage: {args[0]} {{ID|aid:AID}}')
        return
    aid = state.results.parse_aid(args[1], default_key='anidb')
    anime = request_anime(aid)
    query.update.add(state.db, anime)
291045
def get_container_for(self, instance):
        
        if IReferenceAnalysis.providedBy(instance):
            return api.get_uid(instance.getSample())
        return instance.getRequestUID()
637997
def get_reaction_values(self, reaction_id):
        """"""
        if reaction_id not in self._reaction_set:
            raise ValueError('Unknown reaction: {}'.format(repr(reaction_id)))
        return self._database.get_reaction_values(reaction_id)
915399
def identifier(self):
        
        if self.primary_key not in self._data:
            return 'Unknown'
        return str(self._data[self.primary_key])
656921
def get(self, key):
        
        c = self.conn.cursor()
        for row in c.execute("SELECT key, nonce, key_handle, aead, oath_C, oath_T FROM oath WHERE key = ?", (key,)):
            return ValOathEntry(row)
        raise Exception("OATH token for '%s' not found in database (%s)" % (key, self.filename))
1374981
def get_pubtator(pmid):
    
    r = get_url(PUBTATOR_TMPL.replace("PMID", pmid), timeout=10)
    if r and r.status_code == 200:
        pubtator = r.json()[0]
    else:
        log.error(
            f"Cannot access Pubtator, status: {r.status_code} url: {PUBTATOR_TMPL.replace('PMID', pmid)}"
        )
        return None

    known_types = ["CHEBI", "Chemical", "Disease", "Gene", "Species"]

    for idx, anno in enumerate(pubtator["denotations"]):
        s_match = re.match(r"(\w+):(\w+)", anno["obj"])
        c_match = re.match(r"(\w+):(\w+):(\w+)", anno["obj"])
        if c_match:
            (ctype, namespace, cid) = (
                c_match.group(1),
                c_match.group(2),
                c_match.group(3),
            )

            if ctype not in known_types:
                log.info(f"{ctype} not in known_types for Pubtator")
            if namespace not in known_types:
                log.info(f"{namespace} not in known_types for Pubtator")

            pubtator["denotations"][idx][
                "obj"
            ] = f'{pubtator_ns_convert.get(namespace, "UNKNOWN")}:{cid}'
            pubtator["denotations"][idx]["entity_type"] = pubtator_entity_convert.get(
                ctype, None
            )
            pubtator["denotations"][idx][
                "annotation_type"
            ] = pubtator_annotation_convert.get(ctype, None)
        elif s_match:
            (ctype, cid) = (s_match.group(1), s_match.group(2))

            if ctype not in known_types:
                log.info(f"{ctype} not in known_types for Pubtator")

            pubtator["denotations"][idx][
                "obj"
            ] = f'{pubtator_ns_convert.get(ctype, "UNKNOWN")}:{cid}'
            pubtator["denotations"][idx]["entity_type"] = pubtator_entity_convert.get(
                ctype, None
            )
            pubtator["denotations"][idx][
                "annotation_type"
            ] = pubtator_annotation_convert.get(ctype, None)

    annotations = {}
    for anno in pubtator["denotations"]:
        log.info(anno)
        if anno["obj"] not in annotations:
            annotations[anno["obj"]] = {"spans": [anno["span"]]}
            annotations[anno["obj"]]["entity_types"] = [anno.get("entity_type", [])]
            annotations[anno["obj"]]["annotation_types"] = [
                anno.get("annotation_type", [])
            ]

        else:
            annotations[anno["obj"]]["spans"].append(anno["span"])

    del pubtator["denotations"]
    pubtator["annotations"] = copy.deepcopy(annotations)

    return pubtator
108441
def check_in_ase(atoms, ase_db, energy=None):
    """"""

    db_ase = ase.db.connect(ase_db)
    if energy is None:
        energy = atoms.get_potential_energy()
    formula = get_chemical_formula(atoms)
    rows = db_ase.select(energy=energy)
    n = 0
    ids = []
    for row in rows:
        if formula == row.formula:
            n += 1
            ids.append(row.id)
    if n > 0:
        id = ids[0]
        unique_id = db_ase.get(id)['unique_id']
        return id, unique_id
    else:
        return None, None
873010
def get_ea_indexed(self):
        
        addr, postbyte = self.read_pc_byte()
#        log.debug("\tget_ea_indexed(): postbyte: $%02x (%s) from $%04x",
#             postbyte, byte2bit_string(postbyte), addr
#         )

        rr = (postbyte >> 5) & 3
        try:
            register_str = self.INDEX_POSTBYTE2STR[rr]
        except KeyError:
            raise RuntimeError("Register $%x doesn't exists! (postbyte: $%x)" % (rr, postbyte))

        register_obj = self.register_str2object[register_str]
        register_value = register_obj.value
#        log.debug("\t%02x == register %s: value $%x",
#             rr, register_obj.name, register_value
#         )

        if not is_bit_set(postbyte, bit=7): # bit 7 == 0
            # EA = n, R - use 5-bit offset from post-byte
            offset = signed5(postbyte & 0x1f)
            ea = register_value + offset
#             log.debug(
#                 "\tget_ea_indexed(): bit 7 == 0: reg.value: $%04x -> ea=$%04x + $%02x = $%04x",
#                 register_value, register_value, offset, ea
#             )
            return ea

        addr_mode = postbyte & 0x0f
        self.cycles += 1
        offset = None
        # TODO: Optimized this, maybe use a dict mapping...
        if addr_mode == 0x0:
#             log.debug("\t0000 0x0 | ,R+ | increment by 1")
            ea = register_value
            register_obj.increment(1)
        elif addr_mode == 0x1:
#             log.debug("\t0001 0x1 | ,R++ | increment by 2")
            ea = register_value
            register_obj.increment(2)
            self.cycles += 1
        elif addr_mode == 0x2:
#             log.debug("\t0010 0x2 | ,R- | decrement by 1")
            register_obj.decrement(1)
            ea = register_obj.value
        elif addr_mode == 0x3:
#             log.debug("\t0011 0x3 | ,R-- | decrement by 2")
            register_obj.decrement(2)
            ea = register_obj.value
            self.cycles += 1
        elif addr_mode == 0x4:
#             log.debug("\t0100 0x4 | ,R | No offset")
            ea = register_value
        elif addr_mode == 0x5:
#             log.debug("\t0101 0x5 | B, R | B register offset")
            offset = signed8(self.accu_b.value)
        elif addr_mode == 0x6:
#             log.debug("\t0110 0x6 | A, R | A register offset")
            offset = signed8(self.accu_a.value)
        elif addr_mode == 0x8:
#             log.debug("\t1000 0x8 | n, R | 8 bit offset")
            offset = signed8(self.read_pc_byte()[1])
        elif addr_mode == 0x9:
#             log.debug("\t1001 0x9 | n, R | 16 bit offset")
            offset = signed16(self.read_pc_word()[1])
            self.cycles += 1
        elif addr_mode == 0xa:
#             log.debug("\t1010 0xa | illegal, set ea=0")
            ea = 0
        elif addr_mode == 0xb:
#             log.debug("\t1011 0xb | D, R | D register offset")
            # D - 16 bit concatenated reg. (A + B)
            offset = signed16(self.accu_d.value) # FIXME: signed16() ok?
            self.cycles += 1
        elif addr_mode == 0xc:
#             log.debug("\t1100 0xc | n, PCR | 8 bit offset from program counter")
            __, value = self.read_pc_byte()
            value_signed = signed8(value)
            ea = self.program_counter.value + value_signed
#             log.debug("\tea = pc($%x) + $%x = $%x (dez.: %i + %i = %i)",
#                 self.program_counter, value_signed, ea,
#                 self.program_counter, value_signed, ea,
#             )
        elif addr_mode == 0xd:
#             log.debug("\t1101 0xd | n, PCR | 16 bit offset from program counter")
            __, value = self.read_pc_word()
            value_signed = signed16(value)
            ea = self.program_counter.value + value_signed
            self.cycles += 1
#             log.debug("\tea = pc($%x) + $%x = $%x (dez.: %i + %i = %i)",
#                 self.program_counter, value_signed, ea,
#                 self.program_counter, value_signed, ea,
#             )
        elif addr_mode == 0xe:
#             log.error("\tget_ea_indexed(): illegal address mode, use 0xffff")
            ea = 0xffff # illegal
        elif addr_mode == 0xf:
#             log.debug("\t1111 0xf | [n] | 16 bit address - extended indirect")
            __, ea = self.read_pc_word()
        else:
            raise RuntimeError("Illegal indexed addressing mode: $%x" % addr_mode)

        if offset is not None:
            ea = register_value + offset
#             log.debug("\t$%x + $%x = $%x (dez: %i + %i = %i)",
#                 register_value, offset, ea,
#                 register_value, offset, ea
#             )

        ea = ea & 0xffff

        if is_bit_set(postbyte, bit=4): # bit 4 is 1 -> Indirect
#             log.debug("\tIndirect addressing: get new ea from $%x", ea)
            ea = self.memory.read_word(ea)
#             log.debug("\tIndirect addressing: new ea is $%x", ea)

#        log.debug("\tget_ea_indexed(): return ea=$%x", ea)
        return ea
785459
def attr(aid):
    '''
    
    '''
    def _attr(ctx):
        return ctx.current_link[ATTRIBUTES].get(aid)
    return _attr
1257084
def record_id(self, record, type_=None, selector=None):
        """"""
        pk = record_id(record, type_, selector, self.normalize_object_slot)
        return pk
635873
def getChemicalPotential(self, solution):
        
        if isinstance(solution, Solution):
            solution = solution.getSolution()

        self.mu = self.solver.chemicalPotential(solution)
        return self.mu
506757
def get_attribute(self, reference):
        
        prefix, _, name = reference.rpartition('.')

        match = None
        for attribute in self._contents:
            if name == attribute.name and \
                    (not prefix or prefix == attribute.prefix):
                if match:
                    raise AttributeReferenceError(
                        'Ambiguous attribute reference: {}.'.format(
                            attribute.name))
                else:
                    match = attribute

        if match:
            return match
        raise AttributeReferenceError(
            'Attribute does not exist: {}'.format(reference))
657811
public static int getAtomCount(IChemModel chemModel) {
        int count = 0;
        ICrystal crystal = chemModel.getCrystal();
        if (crystal != null) {
            count += crystal.getAtomCount();
        }
        IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
        if (moleculeSet != null) {
            count += MoleculeSetManipulator.getAtomCount(moleculeSet);
        }
        IReactionSet reactionSet = chemModel.getReactionSet();
        if (reactionSet != null) {
            count += ReactionSetManipulator.getAtomCount(reactionSet);
        }
        return count;
    }
925532
def get_int_or_uuid(value):
    
    try:
        uuid.UUID(value)
        return value
    except (ValueError, AttributeError):
        return int(value)
685767
def get_record(self, recid, read_cache=True):
        
        if recid in self.cached_records or not read_cache:
            return self.cached_records[recid]
        else:
            return self.search(p="recid:" + str(recid))
264931
def get(self, test_id):
        '''
        
        '''
        self.select('*', 'test_id=?', [test_id])
        row = self._cursor.fetchone()
        if not row:
            raise KeyError('No report with test id %s in the DB' % test_id)

        values = self.row_to_dict(row)
        content = self._deserialize_dict(values['content'])
        return Report.from_dict(content)