code: def get_current_memory_mb():
      """
      It is used to Obtain the memory usage of the CPU and GPU during the running of the program.
      And this function Current program is time-consuming.
      """
      import pynvml
      import psutil
      import GPUtil
  
      gpu_id = int(os.environ.get("CUDA_VISIBLE_DEVICES", 0))
  
      pid = os.getpid()
      p = psutil.Process(pid)
      info = p.memory_full_info()
      cpu_mem = info.uss / 1024.0 / 1024.0
      gpu_mem = 0
      gpu_percent = 0
      gpus = GPUtil.getGPUs()
      if gpu_id is not None and len(gpus) > 0:
          gpu_percent = gpus[gpu_id].load
          pynvml.nvmlInit()
          handle = pynvml.nvmlDeviceGetHandleByIndex(0)
          meminfo = pynvml.nvmlDeviceGetMemoryInfo(handle)
          gpu_mem = meminfo.used / 1024.0 / 1024.0
      return round(cpu_mem, 4), round(gpu_mem, 4), round(gpu_percent, 4)
  
imports: import time
  import os
  import sys
  import ast
  import argparse
label_desc: Use image node_id 2 for calling a global function with example usage: get_current_memory_mb() and returns: round,  round,  round