def dunder_truncate(_dict):
    keylist = list(_dict.keys())
    def decide_key(k, klist):
        newkey = dunder_last(k)
        return newkey if list(map(dunder_last, klist)).count(newkey) == 1 else k
    original_keys = [decide_key(key, keylist) for key in keylist]
    return dict(zip(original_keys, _dict.values()))
Returns dict with dunder keys truncated to only the last part
dataset/ETHPy150Open naiquevin/lookupy/lookupy/dunderkey.py/dunder_truncate