Skip to content

Instantly share code, notes, and snippets.

@ceoro9
Created May 14, 2019 14:03
Show Gist options
  • Save ceoro9/8428a48fdbdcdf9643855e56b7b6c5df to your computer and use it in GitHub Desktop.
Save ceoro9/8428a48fdbdcdf9643855e56b7b6c5df to your computer and use it in GitHub Desktop.
mapped_images: Iterator[Tuple[TaskImage, UserUploadedImage]] = \
map_task_and_user_uploaded_images(task_images, user_uploaded_images)
overlayed_map_images: List[Tuple[TaskImage, OverlayedImage]] = [
(task_image, user_uploaded_images.convert_to_overlayed_image(task_image),)
for task_image, user_uploaded_images in mapped_images
]
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
for task_image, overlayed_result_image in overlayed_result_image:
task_image.remove()
overlayed_result_image.remove()
for _, user_uploaded_image in mapped_images:
user_uploaded_image.remove()
# --------------------------------------------------------------------------------
# -------------------------------- OR --------------------------------------------
# --------------------------------------------------------------------------------
remove_img_func = lambda img: img.remove()
map(remove_img_func, [task_image for task_image, _ in overlayed_result_image])
map(remove_img_func, [overlayed_result_image for _, overlayed_result_image in overlayed_result_image])
map(remove_img_func, [user_uploaded_image for _, user_uploaded_image in mapped_images])
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment