def freeze(d):
    """Convert the value sets of a multi-valued mapping into frozensets.

    The use case is to make the value sets hashable once they no longer need to be edited.
    """
    return {k: frozenset(v) for k, v in d.items()}