def next_image_partname(self, ext):
        def first_available_image_idx():
            image_idxs = sorted([
                part.partname.idx for part in self.iter_parts()
                if part.partname.startswith('/ppt/media/image')
            ])
            for i, image_idx in enumerate(image_idxs):
                idx = i + 1
                if idx < image_idx:
                    return idx
            return len(image_idxs)+1

        idx = first_available_image_idx()
        return PackURI('/ppt/media/image%d.%s' % (idx, ext))
Function to extract info from a card as returned from PyParsing a
dataset/ETHPy150Open scanny/python-pptx/pptx/package.py/Package.next_image_partname--crossover with--dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/util/namelist_util.py/_process_card_info