def invalidate(cls, widget):
        """
        Remove all canvases cached for widget.
        """
        try:
            for ref in cls._widgets[widget].values():
                try:
                    del cls._refs[ref]
                except KeyError:
                    pass
            del cls._widgets[widget]
        except KeyError:
            pass
        if widget not in cls._deps:
            return
        dependants = cls._deps.get(widget, [])
        try:
            del cls._deps[widget]
        except __HOLE__:
            pass
        for w in dependants:
            cls.invalidate(w)
dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/canvas.py/CanvasCache.invalidate