code: def __get_deepspeed_config(
      self, args: Union[TrainArgs, EvalArgs], train: bool = True
  ):
      if isinstance(args.deepspeed, str):
          if args.deepspeed == "ZERO-2":
              if not train:
                  raise ValueError(
                      "Use ZERO-3 or a path to custom DeepSpeed settings for evaluating"
                  )
              deepspeed = ZERO_2_SETTINGS
          elif args.deepspeed == "ZERO-3":
              deepspeed = ZERO_3_SETTINGS
          else:
              deepspeed = args.deepspeed
      else:
          deepspeed = None
  
      return deepspeed
  
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 18 for calling the HappyTransformer obj's underlying member method code with example usage: obj.__get_deepspeed_config(args, train) and returns: deepspeed