Get an Identity document

    :param current_block: Current block data
    :param uid: Unique IDentifier
    :param salt: Passphrase of the account
    :param password: Password of the account

    :rtype: Identity
346206
def get_identity_document(current_block: dict, uid: str, salt: str, password: str) -> Identity:
    

    # get current block BlockStamp
    timestamp = BlockUID(current_block['number'], current_block['hash'])

    # create keys from credentials
    key = SigningKey.from_credentials(salt, password)

    # create identity document
    identity = Identity(
        version=10,
        currency=current_block['currency'],
        pubkey=key.pubkey,
        uid=uid,
        ts=timestamp,
        signature=None
    )

    # sign document
    identity.sign([key])

    return identity
369037
def get(block_id):
    """"""
    _url = get_root_url()
    try:
        block = DB.get_block_details([block_id]).__next__()
        response = block

        response['links'] = {
            'self': '{}'.format(request.url),
            'list': '{}/processing-blocks'.format(_url),
            'home': '{}'.format(_url)
        }
        return block
    except IndexError as error:
        response = dict(message='Unable to GET Processing Block',
                        id='{}'.format(block_id),
                        error=error.__str__())
        response['links'] = {
            'list': '{}/processing-blocks'.format(_url),
            'home': '{}'.format(_url)
        }
        return response, HTTPStatus.NOT_FOUND
4141
def uuid(dev=None):
    '''
    

    '''
    try:
        if dev is None:
            # take the only directory in /sys/fs/bcache and return it's basename
            return list(salt.utils.path.os_walk('/sys/fs/bcache/'))[0][1][0]
        else:
            # basename of the /sys/block/{dev}/bcache/cache symlink target
            return os.path.basename(_bcsys(dev, 'cache'))
    except Exception:
        return False
1080034
def getTransactionByBlock(self, block_identifier, transaction_index):
        
        method = select_method_for_block_identifier(
            block_identifier,
            if_predefined='eth_getTransactionByBlockNumberAndIndex',
            if_hash='eth_getTransactionByBlockHashAndIndex',
            if_number='eth_getTransactionByBlockNumberAndIndex',
        )
        result = self.web3.manager.request_blocking(
            method,
            [block_identifier, transaction_index],
        )
        if result is None:
            raise TransactionNotFound(
                f"Transaction index: {transaction_index} "
                f"on block id: {block_identifier} not found."
            )
        return result
31832
def get_infos_with_id(self, uid):
        

        _logid = uid
        _user_info_url = USER_INFO_URL.format(logid=_logid)
        return self._request_api(url=_user_info_url).json()
666441
def get_uid(user=None):
    '''
    
    '''
    if not HAS_PWD:
        return None
    elif user is None:
        try:
            return os.geteuid()
        except AttributeError:
            return None
    else:
        try:
            return pwd.getpwnam(user).pw_uid
        except KeyError:
            return None
373584
def gen_signature(self, privkey, pubkey, sig_path):
        '''
        
        '''
        return salt.crypt.gen_signature(privkey,
                                        pubkey,
                                        sig_path,
                                        self.passphrase)
539640
def current_user():
    
    user_id = current_user_id()
    guard = current_guard()
    user = guard.user_class.identify(user_id)
    PraetorianError.require_condition(
        user is not None,
        "Could not identify the current user from the current id",
    )
    return user
965695
def get(self, uid: int) -> FrozenSet[Flag]:
        
        recent = _recent_set if uid in self._recent else frozenset()
        flags = self._flags.get(uid)
        return recent if flags is None else (flags | recent)
381738
def do_auth(self, block_address, force=False):
        
        auth_data = (block_address, self.method, self.key, self.uid)
        if (self.last_auth != auth_data) or force:
            if self.debug:
                print("Calling card_auth on UID " + str(self.uid))

            self.last_auth = auth_data
            return self.rfid.card_auth(self.method, block_address, self.key, self.uid)
        else:
            if self.debug:
                print("Not calling card_auth - already authed")
            return False
1045085
def uid(self):
        
        if not self._uid:
            if self.config.daemon.user:
                self._uid = pwd.getpwnam(self.config.daemon.user).pw_uid
            else:
                self._uid = os.getuid()
        return self._uid
912344
def user_to_uid(user):
    '''
    
    '''
    if user is None:
        user = salt.utils.user.get_user()

    return salt.utils.win_dacl.get_sid_string(user)
513804
def get_user(uid, **kwargs):
    
    user_id=kwargs.get('user_id')
    if uid is None:
        uid = user_id
    user_i = _get_user(uid)
    return user_i
1289818
function (uuids) {
    var guid = uuids[0]
    var sharedKey = uuids[1]

    if (!guid || !sharedKey || guid.length !== 36 || sharedKey.length !== 36) {
      throw 'Error generating wallet identifier'
    }

    return { guid: guid, sharedKey: sharedKey }
  }
477226
def extract_self_cert(signed_raw: str) -> Identity:
        
        lines = signed_raw.splitlines(True)
        n = 0

        version = int(Revocation.parse_field("Version", lines[n]))
        n += 1

        Revocation.parse_field("Type", lines[n])
        n += 1

        currency = Revocation.parse_field("Currency", lines[n])
        n += 1

        issuer = Revocation.parse_field("Issuer", lines[n])
        n += 1

        unique_id = Revocation.parse_field("IdtyUniqueID", lines[n])
        n += 1

        timestamp = Revocation.parse_field("IdtyTimestamp", lines[n])
        n += 1

        signature = Revocation.parse_field("IdtySignature", lines[n])
        n += 1

        return Identity(version, currency, issuer, unique_id, timestamp, signature)
165980
public RecordId currentRecordId() {
		int id = rp.currentId();
		return new RecordId(new BlockId(fileName, currentBlkNum), id);
	}
931883
def get_atlas_zonefile_info_at( self, block_id ):
        
        nameops = self.get_all_blockstack_ops_at( block_id )
        ret = []
        for nameop in nameops:
            if nameop.has_key('op') and op_get_opcode_name(nameop['op']) in ['NAME_UPDATE', 'NAME_IMPORT', 'NAME_REGISTRATION', 'NAME_RENEWAL']:

                assert nameop.has_key('value_hash')
                assert nameop.has_key('name')
                assert nameop.has_key('txid')

                if nameop['value_hash'] is not None:
                    ret.append( {'name': nameop['name'], 'value_hash': nameop['value_hash'], 'txid': nameop['txid']} )

        return ret