def as_nick(self, name):
        """
        Set the nick for the duration of the context.
        """
        orig = self.get_nickname()
        self.nick(name)
        try:
            yield orig
        finally:
            self.nick(orig)
def as_nick ( self , name ) : orig = self . get_nickname ( ) self . nick ( name ) try : yield orig finally : self . nick ( orig )
Set the nick for the duration of the context.