def deco_inside_ctx_method_self(target):
    """decorator: wrap a class method inside a `with self: ...` context"""

    def tgt(self, *args, **kwargs):
        with self:
            return target(self, *args, **kwargs)

    return tgt