code: def __get_device(self):
      device = None
      if torch.backends.mps.is_available():
          if torch.backends.mps.is_built():
              device = torch.device("mps")
  
      if torch.cuda.is_available():
          device = torch.device("cuda:0")
  
      if not device:
          device = torch.device("cpu")
  
      return device
  
imports: import logging
  import os
  import tempfile
  from typing import Union
  from datasets import Dataset, DatasetDict, load_dataset, load_from_disk
  import torch
  from transformers import AutoConfig, AutoModel, AutoTokenizer, Seq2SeqTrainer, Seq2SeqTrainingArguments, Trainer, TrainingArguments
  from happytransformer.args import EvalArgs, TrainArgs
  from happytransformer.fine_tuning_util import EvalResult, FistStep, ZERO_2_SETTINGS, ZERO_3_SETTINGS
label_desc: Use image node_id 5 for calling the HappyTransformer obj's underlying member method code with example usage: obj.__get_device() and returns: device