code: def _determine_root_gpu_device(
      gpus: List[_DEVICE],
  ) -> Optional[_DEVICE]:
      """
      Args:
          gpus: Non-empty list of ints representing which GPUs to use
  
      Returns:
          Designated root GPU device id
  
      Raises:
          TypeError:
              If ``gpus`` is not a list
          AssertionError:
              If GPU list is empty
      """
      if gpus is None:
          return None
  
      if not isinstance(gpus, list):
          raise TypeError("GPUs should be a list")
  
      assert len(gpus) > 0, "GPUs should be a non-empty list"
  
      # set root gpu
      return gpus[0]
  
file_path: pytorch-lightning/src/lightning/fabric/utilities/device_parser.py
imports: from typing import List, MutableSequence, Optional, Tuple, Union
  import torch
  from lightning.fabric.utilities.exceptions import MisconfigurationException
  from lightning.fabric.utilities.types import _DEVICE
label_desc: Use image node_id 1 for calling a global function with example usage: _determine_root_gpu_device(gpus) and returns: gpus, None