def schedule_delayed_delete_from_backend(context, image_id, location):
 db_queue = scrubber.get_scrub_queue()
 if (not CONF.use_user_token):
  context = None
 ret = db_queue.add_location(image_id, location)
 if ret:
  location['status'] = 'pending_delete'
  if ('id' in location):
   db_api.get_api().image_location_delete(context, image_id, location['id'], 'pending_delete')
  else:
   db_api.get_api().image_location_add(context, image_id, location)
 return ret

def schedule_delayed_delete_from_backend ( context , image_id , location ) : db_queue = scrubber . get_scrub_queue ( ) if ( not CONF . use_user_token ) : context = None ret = db_queue . add_location ( image_id , location ) if ret : location [ 'status' ] = 'pending_delete' if ( 'id' in location ) : db_api . get_api ( ) . image_location_delete ( context , image_id , location [ 'id' ] , 'pending_delete' ) else : db_api . get_api ( ) . image_location_add ( context , image_id , location ) return ret
given a location .