def stop(self):
        try:
            if self.process:
                #disconnect the subprocess
                try:
                    result = self.process.poll()
                    if result is None:
                        self.process.kill()
                except __HOLE__:
                    pass

                self.process.wait()
                logging.debug("Subprocess has shut down successfully")

            self.isShuttingDown = True

            if self.subprocessOutThread is not None and not self.isSuprocessOutThread():
                self.subprocessStdOutFromOtherSide.write("\n")
                self.subprocessOutThread.join()
                self.subprocessStdOutFromOtherSide.close()

            if self.subprocessErrThread is not None and not self.isSuprocessErrThread():
                self.subprocessStdErrFromOtherSide.write("\n")
                self.subprocessErrThread.join()
                self.subprocessStdErrFromOtherSide.close()

            self.subprocessStdIn.close()

            logging.debug("SubprocessRunner has shut down successfully")
        finally:
            self.isShuttingDown = False
dataset/ETHPy150Open ufora/ufora/ufora/core/SubprocessRunner.py/SubprocessRunner.stop