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
:rtype: Instance
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/provisioners/aws/provisioner.py/AWSProvisioner._getInstance