def save(self):
        tmp_path = self.path + '.tmp'
        with open(tmp_path, 'w') as f:
            f.write(json.dumps(self.body_labels.items()))
        os.rename(tmp_path, self.path)
def __init__(self, key):
        self.key = key
        self.prio = random.randint(0, 1000000000)
        self.size = 1
        self.left = None
        self.right = None