code: def is_running(process_id: int) -> bool:
      
      pstr = str(process_id)
      encoding = sys.getdefaultencoding()
      s = subprocess.Popen(["ps", "-p", pstr], stdout=subprocess.PIPE)
      for line in s.stdout:
          strline = line.decode(encoding)
          if pstr in strline:
              return True
      return False
docs: Uses the Unix ``ps`` program to see if a process is running.