code: def setup_backend(no_cuda):
      """Setup backend according to selected backend and detected configuration"""
      device = torch.device(
          "cuda" if torch.cuda.is_available() and not no_cuda else "cpu"
      )
      if torch.cuda.is_available() and not no_cuda:
          device = torch.device("cuda")
          n_gpu = torch.cuda.device_count()
      else:
          device = torch.device("cpu")
          n_gpu = 0
      return device, n_gpu
  
imports: import random
  import time
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: setup_backend(no_cuda) and returns: device,  n_gpu