def METHOD_NAME(self):
    """Execute when the command is terminated.
    We should remove the callbacks that were added to the 3D view
    and then close the task panel.
    """
    self.view.removeEventCallbackPivy(self.location,
                                      self.callback_move)
    self.view.removeEventCallbackPivy(self.mouse_event,
                                      self.callback_click)
    if Gui.Control.activeDialog():
        Gui.Control.closeDialog()
        self.finish()