def decode(value):
    """Decode bytes to UTF-8 strings as a singe value, list, or dict.

    :param mixed value:
    :rtype: mixed

    """
    if isinstance(value, list):
        return [decode(v) for v in value]
    elif isinstance(value, dict):
        return {decode(k): decode(v) for k, v in value.items()}
    elif isinstance(value, bytes):
        return value.decode('utf-8')
    return value