def partial_duplicate_destroyer(mydict, tolerance):
    for key1, key2 in combinations(mydict, 2):
        if key1 in mydict and key2 - tolerance < key1 < key2 + tolerance:
            del mydict[key1]
Compare a dict to itself and remove similar keys efficiently