code: def set_gpu_mode(mode, gpu_id=0):
      """Set GPU mode and device ID.
  
      Args:
          mode (bool): Whether or not to use GPU
          gpu_id (int): GPU ID
  
      """
      # pylint: disable=global-statement
      global _GPU_ID
      global _USE_GPU
      global _DEVICE
      _GPU_ID = gpu_id
      _USE_GPU = mode
      _DEVICE = torch.device(
          ("cuda:" + str(_GPU_ID)) if _USE_GPU else "cpu"
      )
  
imports: import copy
  import math
  import warnings
  import torch
  from torch import nn
  import torch.nn.functional
label_desc: Use image node_id 13 for calling a global function with example usage: set_gpu_mode(mode, gpu_id) without return types