@contextmanager
def patch_with_orm_eval():
    try:
        P.eval = orm_eval
        yield
    finally:
        P.eval = original_eval
This must be called from __main__ modules main, instead of app.run().
dataset/ETHPy150Open django-predicate/django-predicate/predicate/debug.py/patch_with_orm_eval--crossover with--dataset/ETHPy150Open google/google-apputils/google/apputils/appcommands.py/Run