code: def print_memory_usage():
      # Get current process
      main_process = psutil.Process(os.getpid())
      # Create an empty dictionary to store metrics
      metrics = {"cpu_usage": [], "memory_usage": []}
      cpu_percent = 0
      mem_usage_mb = 0
      main_process.cpu_percent()
      for process in main_process.children(
          recursive=True
      ):  # Include all child processes
          try:
              cpu_percent += process.cpu_percent()
              mem_usage_mb += process.memory_info().rss / (1024**2)
          except psutil.NoSuchProcess:
              # Process does not exist, so add 0 to cpu_percent and mem_usage_mb
              pass
      cpu_percent += main_process.cpu_percent()
      mem_usage_mb += main_process.memory_info().rss / (1024**2)
      metrics["cpu_usage"].append(cpu_percent)
      metrics["memory_usage"].append(mem_usage_mb)
      print(metrics)
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/src/tools/res_measure.py
imports: import os
  import psutil
  import gpustat
  import threading
  import time
  from src.tools.io_tools import write_json
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: print_memory_usage() without return types