def _pair_instances_to_migrations(self, migrations, instances):
        instance_by_uuid = {inst.uuid: inst for inst in instances}
        for migration in migrations:
            try:
                migration.instance = instance_by_uuid[migration.instance_uuid]
            except __HOLE__:
                # NOTE(danms): If this happens, we don't set it here, and
                # let the code either fail or lazy-load the instance later
                # which is what happened before we added this optimization.
                # This _should_ not be possible, of course.
                LOG.error(_LE('Migration for instance %(uuid)s refers to '
                              'another host\'s instance!'),
                          {'uuid': migration.instance_uuid})
dataset/ETHPy150Open openstack/nova/nova/compute/resource_tracker.py/ResourceTracker._pair_instances_to_migrations