<commit_before>try:
    from shiboken import wrapInstance
except:
    from shiboken2 import wrapInstance


def wrapinstance(*args, **kwargs):
    return wrapInstance(*args, **kwargs)<commit_msg>Added some maya qt utilities<commit_after>try:
    from shiboken import wrapInstance
except:
    from shiboken2 import wrapInstance
#todo add logging

from Qt import QtWidgets

import maya.OpenMayaUI as omui


def wrapinstance(*args, **kwargs):
    return wrapInstance(*args, **kwargs)


def maya_main_window():
    """ Return the QMainWindow for the Maya main Window """

    ptr = omui.MQtUtil.mainWindow()
    if not ptr:
        raise RuntimeError('No Maya window found.')
    window = wrapinstance(long(ptr), QtWidgets.QMainWindow)
    return window


def maya_menu_bar():
    """ Maya menubar for """

    for child in maya_main_window().children():
        if isinstance(child, QtWidgets.QMenuBar):
            return child



{'fraction_non_alphanumeric': 0.09169363538295577, 'fraction_numerical': 0.002157497303128371, 'mean_word_length': 3.8082901554404147, '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': '2847173', 'n_tokens_mistral': 286, 'n_tokens_neox': 274, 'n_words': 85}