code: def get_compute_running_processes(
      handle: _nvmlDevice_t,
  ) -> List[nvmlFriendlyObject]:
      _init_nvml()
      if _nvml_lib is None:
          return None
  
      c_count = c_uint(0)
      func = getattr(
          _nvml_lib, "nvmlDeviceGetComputeRunningProcesses_v3", None
      )
      if func is None:
          func = getattr(
              _nvml_lib, "nvmlDeviceGetComputeRunningProcesses_v2"
          )
      ret = func(handle, byref(c_count), None)
  
      if ret == NVML_SUCCESS:
          # special case, no running processes
          return []
      elif ret == NVML_ERROR_INSUFFICIENT_SIZE:
          # typical case
          # oversize the array incase more processes are created
          c_count.value = c_count.value * 2 + 5
          proc_array = _nvmlProcessInfo_t * c_count.value
          c_procs = proc_array()
  
          _nvml_check_error(func(handle, byref(c_count), c_procs))
  
          procs = []
          for i in range(c_count.value):
              # use an alternative struct for this object
              obj = nvmlStructToFriendlyObject(c_procs[i])
              if (
                  obj.usedGpuMemory
                  == NVML_VALUE_NOT_AVAILABLE_ulonglong.value
              ):
                  # special case for WDDM on Windows, see comment above
                  obj.usedGpuMemory = None
              procs.append(obj)
  
          return procs
      else:
          # error case
          _nvml_check_error(ret)
  
imports: import dataclasses
  import logging
  import os
  import subprocess
  import sys
  import uuid
  from collections import namedtuple
  from ctypes import c_char, c_char_p, c_int, c_uint, c_ulonglong, byref, create_string_buffer, Structure, POINTER, CDLL
  from typing import List, Tuple, Optional, Union
  from ..utils import parse_readable_size
label_desc: Use image node_id 22 for calling a global function with example usage: get_compute_running_processes(handle) and returns: None, list, procs