code: def _check_data_type(device_ids: object) -> None:
      """Checks that the device_ids argument is one of the following: int, string, or sequence of integers.
  
      Args:
          device_ids: gpus/tpu_cores parameter as passed to the Trainer
  
      Raises:
          TypeError:
              If ``device_ids`` of GPU/TPUs aren't ``int``, ``str`` or sequence of ``int```
  
      """
      msg = "Device IDs (GPU/TPU) must be an int, a string, a sequence of ints, but you passed"
      if device_ids is None:
          raise TypeError(f"{msg} None")
      if isinstance(device_ids, (MutableSequence, tuple)):
          for id_ in device_ids:
              id_type = type(
                  id_
              )  # because `isinstance(False, int)` -> True
              if id_type is not int:
                  raise TypeError(
                      f"{msg} a sequence of {type(id_).__name__}."
                  )
      elif type(device_ids) not in (int, str):
          raise TypeError(f"{msg} {device_ids!r}.")
  
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 8 for calling a global function with example usage: _check_data_type(device_ids) without return types