def center_window(self):
        """centers the window to the screen
        """
        desktop = QtGui.QApplication.desktop()
        cursor_pos = QtGui.QCursor.pos()
        desktop_number = desktop.screenNumber(cursor_pos)
        desktop_rect = desktop.screenGeometry(desktop_number)

        size = self.geometry()

        self.move(
            (desktop_rect.width() - size.width()) * 0.5 + desktop_rect.left(),
            (desktop_rect.height() - size.height()) * 0.5 + desktop_rect.top()
        )
dataset/ETHPy150Open eoyilmaz/anima/anima/ui/base.py/AnimaDialogBase.center_window/original