@contextmanager<EOL><INDENT>def temp_flags(self, **kwargs):<DEDENT>
<EOL>saved_flags = {}<EOL>for f in self._flag_names:<EOL><INDENT>saved_flags[f] = getattr(self, f)<EOL><DEDENT>self.set_flags(**kwargs)<EOL>try:<EOL><INDENT>yield<EOL><DEDENT>finally:<EOL><INDENT>self.set_flags(**saved_flags)<EOL><DEDENT>
temporarily set flags, for use in `with` statements.

        See set_flags for permanent setting of flags

        Examples
        --------

        >>> view.track=False
        ...
        >>> with view.temp_flags(track=True):
        ...    ar = view.apply(dostuff, my_big_array)
        ...    ar.tracker.wait() # wait for send to finish
        >>> view.track
        False