def close(self, clear=False):
if clear and not self.leave:<EOL><INDENT>self.clear()<EOL><DEDENT>else:<EOL><INDENT>self.refresh()<EOL><DEDENT>self.manager.remove(self)<EOL>
Do final refresh and remove from manager

If ``leave`` is True, the default, the effect is the same as :py:meth:`refresh`.