code: def get_available_devices(num_gpus: int, auto_select_gpus: bool):
      """
      Get the available devices.
  
      Parameters
      ----------
      num_gpus
          Number of GPUs.
      auto_select_gpus
          Whether to pick GPU indices that are "accessible". See here: https://github.com/Lightning-AI/lightning/blob/accd2b9e61063ba3c683764043030545ed87c71f/src/lightning/fabric/accelerators/cuda.py#L79
  
      Returns
      -------
      The available devices.
      """
      if num_gpus > 0:
          if auto_select_gpus:
              if is_interactive_env():
                  devices = list(range(num_gpus))
              else:
                  devices = find_usable_cuda_devices(num_gpus)
          else:
              devices = num_gpus
      else:
          devices = "auto"
  
      return devices
  
imports: import contextlib
  import logging
  import math
  import sys
  import warnings
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from lightning.pytorch.accelerators import find_usable_cuda_devices
  from torch import nn
  from autogluon.common.utils.resource_utils import ResourceManager
  from ..constants import DDP_STRATEGIES, OBJECT_DETECTION, OCR
label_desc: Use image node_id 11 for calling a global function with example usage: get_available_devices(num_gpus, auto_select_gpus) and returns: devices