def METHOD_NAME(self):
    if (not hasattr(self, 'pythonThread') or self.pythonThread is None or
            not self.pythonThread.alive):
        self.beep()
        return
    self.pythonThread.stopPython()