def METHOD_NAME(partition):
    image_storage = ImageStorage(sm_config)
    for formula_i, imgs in partition:
        iso_image_ids = [None] * n_peaks
        for k, img in enumerate(imgs):
            if img is not None:
                img_bytes = png_generator.generate_png(img.toarray())
                iso_image_ids[k] = image_storage.post_image(
                    image_storage.ISO, ds_id, img_bytes
                )
        yield formula_i, iso_image_ids