def cache_widget_render(cls):
    ignore_focus = bool(getattr(cls, "ignore_focus", False))
    fn = cls.render
    def cached_render(self, size, focus=False):
        focus = focus and not ignore_focus
        canv = CanvasCache.fetch(self, cls, size, focus)
        if canv:
            return canv

        canv = fn(self, size, focus=focus)
        validate_size(self, size, canv)
        if canv.widget_info:
            canv = CompositeCanvas(canv)
        canv.finalize(self, size, focus)
        CanvasCache.store(cls, canv)
        return canv
    cached_render.original_fn = fn
    update_wrapper(cached_render, fn)
    return cached_render
Remove any unpicklable attributes from TestCase instance *case*.
dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/widget.py/cache_widget_render--crossover with--dataset/ETHPy150Open numba/llvmlite/llvmlite/tests/customize.py/_MinimalResult.fixup_case