code: def get_cuda_places():
      gpus_env = os.getenv("FLAGS_selected_gpus")
      if gpus_env:
          device_ids = [int(s) for s in gpus_env.split(",")]
      else:
          device_ids = list(range(paddle.device.cuda.device_count()))
          os.environ["FLAGS_selected_gpus"] = ",".join(
              [str(w) for w in device_ids]
          )
      return device_ids
  
imports: import os
  import paddle
  import paddle.fluid.core
label_desc: Use image node_id 1 for calling a global function with example usage: get_cuda_places() and returns: device_ids