code: def get_per_process_gpu_info(handle: Any) -> List[Dict[str, Any]]:
      processes = pynvml.nvmlDeviceGetComputeRunningProcesses(handle)
      per_process_info = []
      for p in processes:
          info = {"pid": p.pid, "gpu_memory": p.usedGpuMemory}
          per_process_info.append(info)
      return per_process_info
  
file_path: pytorch/tools/stats/monitor.py
imports: import datetime
  import json
  import signal
  import sys
  import time
  from typing import Any, Dict, List
  import psutil
  import pynvml
label_desc: Use image node_id 3 for calling a global function with example usage: get_per_process_gpu_info(handle) and returns: per_process_info