import json


def value_deserializer(message):
    try:
        return json.loads(message.decode("utf-8"))
    except json.decoder.JSONDecodeError:
        return message


def key_deserializer(key):
    try:
        return key.decode("utf-8")
    except AttributeError:
        return key
