<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Select Images
After running the cell above to set things up, you'll need to select
the images you want to prioritize.
Step1:  Store Priorities - DON'T FORGET TO DO THIS - This is what actually queues the images to be tagged
After you select the images, you'll need to actually prioritize them using the function defined in the first cell of this notebook
Step2:  This can take some time.
prioritize_images(every_13th) # very low priority
Check Current Priorities
Step3:  Clear Current Priorities
Delete all of the current priorities.
<ASSISTANT_TASK:>
Python Code:
## EXAMPLE: Get all images from experiment 11.
xp_11_images = all_data_images.filter(xp_id=156)
## EXAMPLE: Get all images from CJRs 140, 158, and 161.
selected_cjrs_images = all_data_images.filter(cjr_id__in=[140,158,161])
## EXAMPLE: Get all images from experiments 11 and 94.
selected_xps_images = all_data_images.filter(xp_id__in=[11,94])
## EXAMPLE: Get every 13th image from experiment 94.
xp_94_images = all_data_images.filter(xp_id__in=[156,157,158,159,162])
every_13th = list(xp_94_images)[::5]
print "{} / {} = {}".format(len(every_13th),
                            xp_94_images.count(),
                            float(xp_94_images.count()) / len(every_13th))
Explanation: Select Images
After running the cell above to set things up, you'll need to select
the images you want to prioritize.
End of explanation
## This can take some time.
prioritize_images(every_13th, priority=100) # very low priority
#prioritize_images(every_13th) # very low priority
Explanation: Store Priorities - DON'T FORGET TO DO THIS - This is what actually queues the images to be tagged
After you select the images, you'll need to actually prioritize them using the function defined in the first cell of this notebook: prioritize_images.
The default priority is 5.  Lower numbered priorities (e.g. 3) will run before higher numbered priorities (e.g. 10).
End of explanation
## EXAMPLE: Find out how many images are currently prioritized.
print dm.PriorityManualImage.objects.count()
## EXAMPLE: Find out which CJRs contain prioritized images.
cjr_list = [x.image.cjr_id for x in dm.PriorityManualImage.objects.all()]
print set(cjr_list)
## EXAMPLE: Find out the proportion of images for experiment 70 that are tagged.
images_in_xp_70 = dm.Image.objects.filter(xp_id=70).count()
tags_for_xp_70 = dm.ManualTag.objects.filter(image__xp_id=70).count()
print "{} / {} = {}".format(tags_for_xp_70, images_in_xp_70, float(tags_for_xp_70) / images_in_xp_70)
Explanation: This can take some time.
prioritize_images(every_13th) # very low priority
Check Current Priorities
End of explanation
### WARNING ###
### THIS WILL DELETE ALL OF YOUR PRIORITIES ###
### WARNING ###
dm.PriorityManualImage.objects.all().delete()
## EXAMPLE: Delete the priorities for experiment 11, if any.
dm.PriorityManualImage.objects.filter(image__xp_id=11).delete()
Explanation: Clear Current Priorities
Delete all of the current priorities.
End of explanation
<END_TASK>