def remove(self, name, func):
was_empty = self._empty()<EOL>if name in self.hooks and func in self.hooks[name]:<EOL><INDENT>self.hooks[name].remove(func)<EOL><DEDENT>if self.app and not was_empty and self._empty(): self.app.reset()<EOL>
Remove a callback from a hook.