code: def watch_jobs(path: Path):
      for job in path.iterdir():
          pid_file = job / "job.pid"
          if not pid_file.exists():
              continue
  
          stopped_file = job / "stopped"
          if stopped_file.exists():
              continue
  
          with open(str(pid_file), "r") as f:
              content = f.read().strip()
              pid = int(content)
  
          if not psutil.pid_exists(pid):
              with open(str(stopped_file), "w") as f:
                  f.write("not running")
  
imports: import time
  from pathlib import Path
  import psutil
  from labml import monit
label_desc: Use image node_id 1 for calling a global function with example usage: watch_jobs(path) without return types