def run_from_datastore(key):
 entity = _DeferredTaskEntity.get(key)
 if (not entity):
  raise PermanentTaskFailure()
 try:
  ret = run(entity.data)
  entity.delete()
 except PermanentTaskFailure:
  entity.delete()
  raise

def run_from_datastore ( key ) : entity = _DeferredTaskEntity . get ( key ) if ( not entity ) : raise PermanentTaskFailure ( ) try : ret = run ( entity . data ) entity . delete ( ) except PermanentTaskFailure : entity . delete ( ) raise
retrieves a task from the datastore and executes it .