<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def onWith(self, evnt, func):
        '''
        A context manager which can be used to add a callback and remove it when
        using a ``with`` statement.

        Args:
            evnt (str):         An event name
            func (function):    A callback function to receive event tufo
        '''
        self.on(evnt, func)
        # Allow exceptions to propagate during the context manager
        # but ensure we cleanup our temporary callback
        try:
            yield self
        finally:
            self.off(evnt, func)