@contextlib.contextmanager<EOL><INDENT>def get_context_manager(self, default):<DEDENT>
try:<EOL><INDENT>self.stack.append(default)<EOL>yield default<EOL><DEDENT>finally:<EOL><INDENT>if self.enforce_nesting:<EOL><INDENT>if self.stack[-<NUM_LIT:1>] is not default:<EOL><INDENT>raise AssertionError(<EOL>"<STR_LIT>"<EOL>% type(default))<EOL><DEDENT>self.stack.pop()<EOL><DEDENT>else:<EOL><INDENT>self.stack.remove(default)<EOL><DEDENT><DEDENT>
A context manager for manipulating a default stack.