code: def mark_pid_for_dead_process(server_id):
      """
      Resource files for a dead server only deleted when user closes the server in frontend.
      When user close the server, pid recorded in logfile will be killed.
      In case a dead process id is reassigned for a new process, we should mark the pid recorded in logfile as outdated.
      Here, we choose to replace the pid to -1 in logfile to denote the zombie process \
          which has been polled and becomes dead.
      Args:
          server_id(str): fastdeployserver process name
      """
      if os.path.exists(
          os.path.join(FASTDEPLOYSERVER_PATH, "{}".format(server_id))
      ):
          with open(
              os.path.join(
                  FASTDEPLOYSERVER_PATH, "{}".format(server_id)
              ),
              "r",
          ) as f:
              contents = f.read().split("\n")
          contents[1] = "-1"  # we replace pid to -1
          with open(
              os.path.join(
                  FASTDEPLOYSERVER_PATH, "{}".format(server_id)
              ),
              "w",
          ) as f:
              f.write("\n".join(contents))
  
imports: import copy
  import json
  import os
  import random
  import re
  import signal
  import string
  from collections import defaultdict
  from subprocess import Popen
  from subprocess import STDOUT
  import google.protobuf.json_format
  import google.protobuf.text_format
  import psutil
  import requests
  from .proto.model_config_pb2 import ModelConfig
  from visualdl.utils.dir import FASTDEPLOYSERVER_PATH
label_desc: Use image node_id 19 for calling a global function with example usage: mark_pid_for_dead_process(server_id) without return types