def safe_sort_key(value):
    if isinstance(value, collections.Mapping):
        return sorted(value.items())
    return value
Return value hash or build one for dictionaries.
dataset/ETHPy150Open openstack/neutron/neutron/common/utils.py/safe_sort_key