<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _purge_unreachable(self, key):
 """ Purge unreachable dominated key paths before inserting a new key path. """

        dels = []
        for p in self:
            if dominates(key, p):
                dels.append(p)
        for k in dels:
            _, idxs = find_in_tree(self.root, k, perfect=True)
            del_by_idx(self.root, idxs)