def PlugOut(self):
        """ Unregister all our staff from main instance and detach from it. """
        self.DEBUG('Plugging %s out of %s.'%(self,self._owner),'stop')
        ret = None
        if self.__class__.__dict__.has_key('plugout'): ret = self.plugout()
        self._owner.debug_flags.remove(self.DBG_LINE)
        for method in self._exported_methods: del self._owner.__dict__[method.__name__]
        for method in self._old_owners_methods: self._owner.__dict__[method.__name__]=method
        del self._owner.__dict__[self.__class__.__name__]
        return ret
 Unregister all our staff from main instance and detach from it. 
chrome-cordova/gcmServer/xmpp/client.py