code: def _get_allocation_counts():
      """
      Returns the allocation counts from the current device resource
      """
      import rmm
  
      mr = rmm.mr.get_current_device_resource()
      if not hasattr(mr, "allocation_counts"):
          if hasattr(mr, "upstream_mr"):
              return _get_allocation_counts(mr.upstream_mr)
          else:
              return -1
      else:
          return mr.allocation_counts
  
imports: import os
  import tempfile
  from pprint import pformat
  import time
  from dask.distributed import wait, default_client
  from dask import persist
  from dask.distributed import Client
  from dask.base import is_dask_collection
  from dask_cuda import LocalCUDACluster
  from dask_cuda.initialize import initialize
  from cugraph.dask.comms import comms
  from cugraph.dask.common.mg_utils import get_visible_devices
  from cugraph.generators import rmat
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: _get_allocation_counts() and returns: mr, _get_allocation_counts, unknown