code: def setdelegate(self, delegate):
      if self.delegate is not None:
          self.unbind("<<undo>>")
          self.unbind("<<redo>>")
          self.unbind("<<dump-undo-state>>")
      Delegator.setdelegate(self, delegate)
      if delegate is not None:
          self.bind("<<undo>>", self.undo_event)
          self.bind("<<redo>>", self.redo_event)
          self.bind("<<dump-undo-state>>", self.dump_event)
  
imports: import string
  from idlelib.delegator import Delegator
label_desc: Use image node_id 2 for calling the UndoDelegator obj's underlying member method code with example usage: obj.setdelegate(delegate) without return types