code: def _get_cuda_available_devices():
      import ctypes
  
      try:
          devices = os.environ["CUDA_VISIBLE_DEVICES"].split(",")
          return [] if devices[0] == "" else [int(i) for i in devices]
      except KeyError:
          pass
  
      try:
          cuda_lib = ctypes.CDLL("libcuda.so")
      except OSError:
          return []
  
      CUDA_SUCCESS = 0
  
      num_gpus = ctypes.c_int()
      result = cuda_lib.cuInit(0)
      if result != CUDA_SUCCESS:
          return []
      result = cuda_lib.cuDeviceGetCount(ctypes.byref(num_gpus))
      if result != CUDA_SUCCESS:
          return []
      return list(range(num_gpus.value))
  
imports: import sys
  import copy
  from configparser import ConfigParser, Error
  import os
  from rl_coach import logger
  import traceback
  from rl_coach.logger import screen, failed_imports
  import argparse
  import atexit
  import time
  import sys
  import json
  from rl_coach.base_parameters import Frameworks, VisualizationParameters, TaskParameters, DistributedTaskParameters, RunType, DistributedCoachSynchronizationType
  from rl_coach.core_types import TotalStepsCounter, RunPhase, PlayingStepsType, TrainingSteps, EnvironmentEpisodes, EnvironmentSteps, StepMethod, Transition
  from multiprocessing import Process
  from multiprocessing.managers import BaseManager
  import subprocess
  from glob import glob
  from rl_coach.graph_managers.graph_manager import HumanPlayScheduleParameters, GraphManager
  from rl_coach.utils import list_all_presets, short_dynamic_import, get_open_port, SharedMemoryScratchPad, get_base_dir, set_gpu
  from rl_coach.graph_managers.basic_rl_graph_manager import BasicRLGraphManager
  from rl_coach.environments.environment import SingleLevelSelection
  from rl_coach.memories.backend.redis import RedisPubSubMemoryBackendParameters
  from rl_coach.memories.backend.memory_impl import construct_memory_params
  from rl_coach.data_stores.data_store import DataStoreParameters
  from rl_coach.data_stores.s3_data_store import S3DataStoreParameters
  from rl_coach.data_stores.nfs_data_store import NFSDataStoreParameters
  from rl_coach.data_stores.redis_data_store import RedisDataStoreParameters
  from rl_coach.data_stores.data_store_impl import get_data_store, construct_data_store_params
  from rl_coach.training_worker import training_worker
  from rl_coach.rollout_worker import rollout_worker
  from rl_coach.schedules import *
  from rl_coach.exploration_policies.e_greedy import *
label_desc: Use image node_id 1 for calling a global function with example usage: _get_cuda_available_devices() and returns: list, unknown, list, list, list