def __enter__(self):
        if self.enabled:
            self.original_value = getattr(self.object, self.attribute)
            setattr(self.object, self.attribute, self.patched_value)
Change the object attribute when entering the context.
dataset/ETHPy150Open paylogic/pip-accel/pip_accel/__init__.py/PatchedAttribute.__enter__