<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def auth_as(self, user):
 """auth as a user temporarily"""

        old_user = self._user
        self.auth(user)
        try:
            yield
        finally:
            self.auth(old_user)