Return a did value and value type from the block chain event record using 'did'.

        :param did_bytes: DID, hex-str
        :return url: Url, str
978251
def get_resolve_url(self, did_bytes):
        
        data = self._did_registry.get_registered_attribute(did_bytes)
        if not (data and data.get('value')):
            return None

        return data['value']
713757
def rpc_get_name_blockchain_record(self, name, **con_info):
        
        res = None
        if check_name(name):
            res = self.get_name_record(name, include_expired=True, include_history=True)
        elif check_subdomain(name):
            res = self.get_subdomain_record(name, include_history=True)
        else:
            return {'error': 'Invalid name or subdomain', 'http_status': 400}

        if 'error' in res:
            return {'error': res['error'], 'http_status': res.get('http_status', 404)}

        return self.success_response({'record': res['record']})
644655
def ReadByte(self, do_ord=True):
        
        try:
            if do_ord:
                return ord(self.stream.read(1))
            return self.stream.read(1)
        except Exception as e:
            logger.error("ord expected character but got none")
        return 0
206798
def block_uid(value: Union[str, BlockUID, None]) -> BlockUID:
    
    if isinstance(value, BlockUID):
        return value
    elif isinstance(value, str):
        return BlockUID.from_str(value)
    elif value is None:
        return BlockUID.empty()
    else:
        raise TypeError("Cannot convert {0} to BlockUID".format(type(value)))
865099
function _getBlock (config, type, multi) {
  const options = {
    uri: _buildUrl(config, type, multi)
  }

  if (config.headers) {
    options['headers'] = config.headers
  }
  return request.get(options).then(result => { return { blockName: type, result: result } })
}
390457
def get_done_url(self):
        
        url = self.bundle.get_view_url(self.redirect_to_view,
                                        self.request.user, {}, self.kwargs)
        return self.customized_return_url(url)
107174
def cred_def_id(issuer_did: str, schema_seq_no: int) -> str:
    

    return '{}:3:CL:{}:{}'.format(issuer_did, schema_seq_no, CD_ID_TAG)
1017752
def upload_bytes_per_chunk(self):
        
        value = self.values.get(Config.UPLOAD_BYTES_PER_CHUNK, DDS_DEFAULT_UPLOAD_CHUNKS)
        return Config.parse_bytes_str(value)
18384
def ProduceEventWithEventData(self, event, event_data):
    
    if event.timestamp is None:
      raise errors.InvalidEvent('Event timestamp value not set.')

    if event.timestamp < self._INT64_MIN or event.timestamp > self._INT64_MAX:
      raise errors.InvalidEvent('Event timestamp value out of bounds.')

    event_data_hash = event_data.GetAttributeValuesHash()
    if event_data_hash != self._last_event_data_hash:
      # Make a copy of the event data before adding additional values.
      event_data = copy.deepcopy(event_data)

      # TODO: refactor to ProcessEventData.
      self.ProcessEvent(
          event_data, parser_chain=self.GetParserChain(),
          file_entry=self._file_entry)

      self._storage_writer.AddEventData(event_data)

      self._last_event_data_hash = event_data_hash
      self._last_event_data_identifier = event_data.GetIdentifier()

    if self._last_event_data_identifier:
      event.SetEventDataIdentifier(self._last_event_data_identifier)

    # TODO: remove this after structural fix is in place
    # https://github.com/log2timeline/plaso/issues/1691
    event.parser = self.GetParserChain()

    self._storage_writer.AddEvent(event)
    self._number_of_events += 1

    self.last_activity_timestamp = time.time()
1161221
def get_name_DID_record(self, did):
        
        try:
            did_info = parse_DID(did)
            assert did_info['name_type'] == 'name'
        except Exception as e:
            if BLOCKSTACK_DEBUG:
                log.exception(e)

            return {'error': 'Invalid DID', 'http_status': 400}

        db = get_db_state(self.working_dir)
        rec = db.get_DID_name(did)
        if rec is None:
            db.close()
            return {'error': 'Failed to resolve DID to a non-revoked name', 'http_status': 404}

        name_record = self.load_name_info(db, rec)
        db.close()

        if name_record is None:
            return {'error': 'DID does not resolve to an existing name', 'http_status': 404}

        return {'record': name_record}
597788
def get_block_transaction_hashes(self, block_header: BlockHeader) -> Iterable[Hash32]:
        
        return self._get_block_transaction_hashes(self.db, block_header)
324815
def id_to_did(did_id, method='op'):
    """"""
    if isinstance(did_id, bytes):
        did_id = Web3.toHex(did_id)

    # remove leading '0x' of a hex string
    if isinstance(did_id, str):
        did_id = remove_0x_prefix(did_id)
    else:
        raise TypeError("did id must be a hex string or bytes")

    # test for zero address
    if Web3.toBytes(hexstr=did_id) == b'':
        did_id = '0'
    return f'did:{method}:{did_id}'
113568
def read_byte(self, do_ord=True) -> int:
        
        try:
            if do_ord:
                return ord(self.stream.read(1))
            else:
                return self.stream.read(1)
        except Exception as e:
            raise SDKException(ErrorCode.read_byte_error(e.args[0]))
748749
async def get_nym(self, did: str) -> str:
        

        LOGGER.debug('_BaseAgent.get_nym >>> did: %s', did)

        rv = json.dumps({})
        get_nym_req = await ledger.build_get_nym_request(self.did, did)
        resp_json = await self._submit(get_nym_req)

        data_json = (json.loads(resp_json))['result']['data']  # it's double-encoded on the ledger
        if data_json:
            rv = data_json

        LOGGER.debug('_BaseAgent.get_nym <<< %s', rv)
        return rv
477877
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor not initialized')

        rec = struct.pack(self.FMT, b'\x00' * 16, b'\x00' * 496)[16:]
        return self.desc_tag.record(rec) + rec
848206
def decode_event(abi: Dict, log: Dict):
    
    if isinstance(log['topics'][0], str):
        log['topics'][0] = decode_hex(log['topics'][0])
    elif isinstance(log['topics'][0], int):
        log['topics'][0] = decode_hex(hex(log['topics'][0]))
    event_id = log['topics'][0]
    events = filter_by_type('event', abi)
    topic_to_event_abi = {
        event_abi_to_log_topic(event_abi): event_abi
        for event_abi in events
    }
    event_abi = topic_to_event_abi[event_id]
    return get_event_data(event_abi, log)
439626
def get_subdomain_DID_info(fqn, db_path=None, zonefiles_dir=None):
    
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        log.warn("Subdomain support is disabled")
        return None

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    db = SubdomainDB(db_path, zonefiles_dir)
    try:
        subrec = db.get_subdomain_entry(fqn)
    except SubdomainNotFound:
        log.warn("No such subdomain: {}".format(fqn))
        return None
    
    try:
        return db.get_subdomain_DID_info(fqn)
    except SubdomainNotFound:
        return None