code: def get_device_id(canonical_name):
      """
      Given a local device id, find the actual "global" id
      :param canonical_name: the local device name in CUDA_VISIBLE_DEVICES
      :return: the global device id for the system
      """
      dev_order = get_visible_devices()
      idx = 0
      for dev in dev_order:
          if dev == canonical_name:
              return idx
          idx += 1
  
      return -1
  
imports: from threading import Lock
  from asyncio import InvalidStateError
  from cuml.internals.import_utils import check_min_dask_version
  from cuml.common import device_of_gpu_matrix
  from dask.distributed import default_client, wait
  import time
  import random
  import dask
  import logging
  import os
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 3 for calling a global function with example usage: get_device_id(canonical_name) and returns: unknown, idx