#NEWLINE# def Delete( self , queue , tasks , mutation_pool = None ) : #NEWLINE# #INDENT# 'Removes the tasks from the queue.\n\n    Note that tasks can already have been removed. It is not an error\n    to re-delete an already deleted task.\n\n    Args:\n     queue: A queue to clear.\n     tasks: A list of tasks to remove. Tasks may be Task() instances\n          or integers representing the task_id.\n     mutation_pool: An optional MutationPool object to schedule deletions on.\n                    If not given, self.data_store is used directly.\n    ' #NEWLINE# if queue : #NEWLINE# #INDENT# predicates = [ ] #NEWLINE# for task in tasks : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# task_id = task . task_id #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# task_id = int ( task ) #NEWLINE# #UNINDENT# predicates . append ( self . _TaskIdToColumn ( task_id ) ) #NEWLINE# #UNINDENT# if mutation_pool : #NEWLINE# #INDENT# mutation_pool . DeleteAttributes ( queue , predicates ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . data_store . DeleteAttributes ( queue , predicates , token = self . token , sync = False )