Created
May 14, 2019 14:03
-
-
Save ceoro9/8428a48fdbdcdf9643855e56b7b6c5df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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