<commit_before>
from ..core import BindingWindow

from maya import cmds
from maya.OpenMayaUI import MQtUtil

try:
    from shiboken import wrapInstance
    from PySide.QtGui import QWidget, QDialog
    from PySide import QtCore
except ImportError:
    from shiboken2 import wrapInstance
    from PySide2.QtWidgets import QWidget, QDialog
    from PySide2 import QtCore

class ModalWindow(BindingWindow):

    def __init__(self, *args, **kwargs):
        super(ModalWindow, self).__init__(*args, **kwargs)
        ptr = MQtUtil.findWindow(self.widget)
        self._qt_obj = wrapInstance(long(ptr), QWidget)
        self._qt_obj.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
        
<commit_msg>Tweaked ModalWindow to use the new _compat module.<commit_after>
from maya import cmds
from mGui.core import BindingWindow
from mGui.qt._compat import as_qt_object, QtCore


class ModalWindow(BindingWindow):

    def __init__(self, *args, **kwargs):
        super(ModalWindow, self).__init__(*args, **kwargs)
        self._qt_obj = as_qt_object(self)
        self._qt_obj.setWindowModality(
            QtCore.Qt.WindowModality.ApplicationModal)

{'fraction_non_alphanumeric': 0.07958477508650519, 'fraction_numerical': 0.0025951557093425604, 'mean_word_length': 3.902542372881356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6373114', 'n_tokens_mistral': 359, 'n_tokens_neox': 353, 'n_words': 91}