import random


def shuffle_dict(phoneme_rune_dict):
    """
    Update a dict by making a random swap. This creates a new dict
    instead of updating the dict.
    """
    phonemes_1 = list(phoneme_rune_dict.keys())
    phoneme_1 = random.choice(phonemes_1)

    phonemes_2 = list(set(phonemes_1) - set(phoneme_1))
    phoneme_2 = random.choice(phonemes_2)

    next_dict = phoneme_rune_dict.copy()
    (next_dict[phoneme_1], next_dict[phoneme_2]) = (next_dict[phoneme_2], next_dict[phoneme_1])

    return next_dict