def cancel_action(self, argstr):
        cancelled = 0
        plural = 's'
        for action in Action.objects:
            if action.completed: continue
            if action.description == argstr:
                try:
                    action.deferred.cancel()
                    cancelled += 1
                except: pass
        if cancelled == 1: plural = ''
        return (0, 'cancelled %d task%s' % (cancelled, plural))
Usage: cancel 'task' - cancels all tasks matching the description
dataset/ETHPy150Open OrbitzWorldwide/droned/droned/lib/droned/models/server.py/DroneServer.cancel_action