Get a beam from the session with `secret_uuid`.

    Parameters
    ----------
    secret_uuid : str

    Returns
    -------
    The beam object if it exists, otherwise `None`.
347876
def get_beam(secret_uuid):
    
    beam_dir = get_beam_cache_directory()
    beam_filename = os.path.join(beam_dir, secret_uuid)
    if os.path.isfile(beam_filename):
        with open(beam_filename, 'rb') as handle:
            beam = pickle.load(handle)
        return beam
    else:
        return None
1171036
def _regenerate_secret_key(self):
        
        # Don't regenerate the key if we have none
        if self._session and 'secret_key' in self._session:
            self._session['secret_key'] = (
                int(self._session['secret_key']) * 16807) % 2147483647
578379
async def get_ssh_key(self, raw_ssh=False):
        
        key_facade = client.KeyManagerFacade.from_connection(self.connection())
        entity = {'tag': tag.model(self.info.uuid)}
        entities = client.Entities([entity])
        return await key_facade.ListKeys(entities, raw_ssh)
991539
def _add_secret_hash(self, parameters, key):
        
        if self.client_secret is not None:
            secret_hash = AWSSRP.get_secret_hash(self.username, self.client_id,
                                                 self.client_secret)
            parameters[key] = secret_hash
201936
def getClientUID(self):
        
        request = self.getRequest()
        if request:
            client = request.getClient()
            if client:
                return client.UID()
216170
def get_jwt_secret():
    
    secret_key = __options__.get("jwt_secret") or config("JWT_SECRET") or config("SECRET_KEY")
    if not secret_key:
        raise exceptions.AuthError("Missing config JWT/SECRET_KEY")
    return secret_key
589499
function(secret) {
        var keyIv;
        if (!secret) {
          throw new CError('missing secret').log();
        }
        // secret is a Base64 string
        if(secret.isBase64()){
          try {
            keyIv = forge.util.decode64(secret);
          } catch (e) {
            throw new CError('secret not valid').log();
          }
        } else {
          keyIv = secret;
        }
        return keyIv;
      }
547799
def get_token(self):
        
        self.token = self._session.fetch_token(
            token_url=CLOUD_URLS["get_token"][1],
            client_id=self._client_id,
            client_secret=self._client_secret
        )
325716
def get_client_secret(self):
        
        self._client_secret = predix.config.get_env_value(predix.app.Manifest, 'client_secret')
        return self._client_secret
894165
function getKeys (secret) {
	var hash = crypto.createHash('sha256').update(secret, 'utf8').digest();
	var keypair = naclInstance.crypto_sign_keypair_from_seed(hash);

	return {
		publicKey : Buffer.from(keypair.signPk).toString('hex'),
		privateKey : Buffer.from(keypair.signSk).toString('hex')
	};
}
650052
def uuid4(self, cast_to=str):
        
        # Based on http://stackoverflow.com/q/41186818
        return cast_to(uuid.UUID(int=self.generator.random.getrandbits(128), version=4))
568096
def get(self, uuid):
        """"""
        for token in self.list():
            if token.get('uuid') == uuid:
                return token
        raise LinShareException(-1, "Can find uuid:" + uuid)
410888
def _get_secret_from_vault(
        key, environment=None, stage=None, namespace=None,
        wait_exponential_multiplier=50, wait_exponential_max=5000,
        stop_max_delay=10000):
    """"""
    # Get the encrypted secret from DynamoDB
    table_name = _secrets_table_name(environment=environment, stage=stage)

    if namespace:
        key = "{}:{}".format(namespace, key)

    if table_name is None:
        logger.warning("Can't produce secrets table name: unable to retrieve "
                       "secret '{}'".format(key))
        return

    client = boto3.client('dynamodb')
    logger.info("Retriving key '{}' from table '{}'".format(
        key, table_name))

    @retry(retry_on_exception=_is_critical_exception,
           wait_exponential_multiplier=wait_exponential_multiplier,
           wait_exponential_max=wait_exponential_max,
           stop_max_delay=stop_max_delay)
    def get_item():
        try:
            return client.get_item(
                TableName=table_name,
                Key={'id': {'S': key}}).get('Item', {}).get(
                    'value', {}).get('B')
        except Exception as err:
            if _is_dynamodb_critical_exception(err):
                raise CriticalError(err)
            else:
                raise

    encrypted = get_item()

    if encrypted is None:
        return

    # Decrypt using KMS
    client = boto3.client('kms')
    try:
        value = client.decrypt(CiphertextBlob=encrypted)['Plaintext'].decode()
    except ClientError:
        logger.error("KMS error when trying to decrypt secret")
        traceback.print_exc()
        return

    try:
        value = json.loads(value)
    except (TypeError, ValueError):
        # It's ok, the client should know how to deal with the value
        pass

    return value
1240631
def getbyuuid(self, uuid):
        
        if uuid not in self._schbyuuid:
            raise KeyError('uuid {0} not registered'.format(uuid))

        return self._schbyuuid[uuid]
46421
def get_member_by_uuid(self, member_uuid):
        
        for member in self.get_member_list():
            if member.uuid == member_uuid:
                return member
715975
def get_password_hash(username):
    
    try:
        h = spwd.getspnam(username)
    except KeyError:
        return None

    # mitogen.core.Secret() is a Unicode subclass with a repr() that hides the
    # secret data. This keeps secret stuff out of logs. Like blobs, secrets can
    # also be serialized.
    return mitogen.core.Secret(h)
617079
def retrieve_secret_id(url, token):
    """"""
    import hvac
    client = hvac.Client(url=url, token=token)
    response = client._post('/v1/sys/wrapping/unwrap')
    if response.status_code == 200:
        data = response.json()
        return data['data']['secret_id']