def remove_cb(self, cb):
    cb.learn = None
    if hasattr(self, cb.name):
        delattr(self, cb.name)
    if (cb in self.cbs):
        self.cbs.remove(cb)
def remove_cb(self, cb):
    cb.learn = None
    if hasattr(self, cb.name):
        delattr(self, cb.name)
    if (cb in self.cbs):
        self.cbs.remove(cb)