code: def kill_ghosts():
      
      detect_process = ["vpcs", "ubridge", "dynamips"]
      for proc in psutil.process_iter():
          try:
              name = proc.name().lower().split(".")[0]
              if name in detect_process:
                  proc.kill()
                  log.warning("Killed ghost process %s", name)
          except (psutil.NoSuchProcess, psutil.AccessDenied):
              pass
docs: Kill process from previous GNS3 session