def _write_pid_file(self, filename):
        fs.write_file(str(os.getpid()), filename)

        def remove_pid_file():
            try:
                os.remove(filename)
            except __HOLE__:
                pass
        UnhandledExceptionHandler.singleton().add_teardown_callback(remove_pid_file)
dataset/ETHPy150Open box/ClusterRunner/app/subcommands/service_subcommand.py/ServiceSubcommand._write_pid_file