def _getInstance(self, instance_id):
        reservations = self._ec2.get_all_reservations(instance_ids=[instance_id])
        instances = (i for r in reservations for i in r.instances if i.id == instance_id)
        instance = next(instances)
        assert next(instances, None) is None
        return instance
Delete a snapshot
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/provisioners/aws/provisioner.py/AWSProvisioner._getInstance--crossover with--dataset/ETHPy150Open openstack/python-openstacksdk/openstack/block_store/v2/_proxy.py/Proxy.delete_snapshot