def deserialize_key_value(value, secret=False):
    """
    Deserialize the datastore item value.

    Note: Right now only strings as supported so only thing this function does is it decrypts
    secret values.

    :param value: Value to deserialize.
    :type value: ``str``

    :param secret: True if a value is a secret and is encrypted.
    :type secret: ``bool``
    """
    if secret:
        KeyValuePairAPI._setup_crypto()
        value = symmetric_decrypt(KeyValuePairAPI.crypto_key, value)

    return value

    Deserialize the datastore item value.

    Note: Right now only strings as supported so only thing this function does is it decrypts
    secret values.

    :param value: Value to deserialize.
    :type value: ``str``

    :param secret: True if a value is a secret and is encrypted.
    :type secret: ``bool``
    
st2common/st2common/services/config.py