@contextmanager
def patch_with_orm_eval():
    try:
        P.eval = orm_eval
        yield
    finally:
        P.eval = original_eval
Patches P.eval with the orm_eval version for debugging and validation.
dataset/ETHPy150Open django-predicate/django-predicate/predicate/debug.py/patch_with_orm_eval