def cleanup_attached_vdis(session):
    this_vm_ref = _get_this_vm_ref(session)

    vbd_refs = session.call_xenapi('VM.get_VBDs', this_vm_ref)
    for vbd_ref in vbd_refs:
        try:
            vdi_ref = session.call_xenapi('VBD.get_VDI', vbd_ref)
            vdi_rec = session.call_xenapi('VDI.get_record', vdi_ref)
        except session.XenAPI.Failure as e:
            if e.details[0] != 'HANDLE_INVALID':
                raise
            continue

        if 'nova_instance_uuid' in vdi_rec['other_config']:
            # Belongs to an instance and probably left over after an
            # unclean restart
            LOG.info(_LI('Disconnecting stale VDI %s from compute domU'),
                     vdi_rec['uuid'])
            unplug_vbd(session, vbd_ref, this_vm_ref)
            destroy_vbd(session, vbd_ref)
Returns the n x k matrix of square_distances between each of the n
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.py/cleanup_attached_vdis--crossover with--dataset/ETHPy150Open omangin/multimodal/multimodal/lib/vector_quantization.py/square_distances