def flip(mapping):
    """Flip passed dict or collection of pairs swapping its keys and values."""
    def flip_pair(pair):
        k, v = pair
        return v, k
    return walk(flip_pair, mapping)
Flip passed dict or collection of pairs swapping its keys and values.
funcy/colls.py