def _cleanup(self, wr, key=None):
        if key is None:
            key = wr.key
        try:
            del self._weakrefs[key]
        except (KeyError, AttributeError):  # pragma: no cover
            pass                            # pragma: no cover
        try:
            del self.by_id[key]
        except (__HOLE__, AttributeError):  # pragma: no cover
            pass                            # pragma: no cover
dataset/ETHPy150Open ralfonso/theory/theory/model/mpdutil.py/WeakIdentityMapping._cleanup