@contextlib.contextmanager
def act_as_user_context(conduit, user):
    prevUser = conduit.get_act_as_user()
    try:
        conduit.set_act_as_user(user)
        yield conduit
    finally:
        if prevUser:
            conduit.set_act_as_user(prevUser)
        else:
            conduit.clear_act_as_user()
Translate specified string.
dataset/ETHPy150Open bloomberg/phabricator-tools/py/phl/phlsys_conduit.py/act_as_user_context--crossover with--dataset/ETHPy150Open lingthio/Flask-User/flask_user/translations.py/gettext