code: def __init__(
      self,
      hyperparam_optimizer=None,
      log_path=None,
      python_cmd="python3",
      enable_log_err=True,
      enable_log_out=True,
  ):
      self.hyperparam_optimizer = hyperparam_optimizer
      self.log_path = log_path
  
      self.enable_log_err = enable_log_err
      self.enable_log_out = enable_log_out
      self.slurm_files_log_path = None
      self.err_log_path = None
      self.out_log_path = None
      self.modules = []
      self.script_name = os.path.realpath(sys.argv[0])
      self.job_time = "15:00"
      self.minutes_to_checkpoint_before_walltime = 5
      self.per_experiment_nb_gpus = 1
      self.per_experiment_nb_cpus = 1
      self.per_experiment_nb_nodes = 1
      self.memory_mb_per_node = 2000
      self.email = None
      self.notify_on_end = False
      self.notify_on_fail = False
      self.job_name = None
      self.python_cmd = python_cmd
      self.gpu_type = None
      self.on_gpu = False
      self.call_load_checkpoint = False
      self.commands = []
      self.slurm_commands = []
      self.hpc_exp_number = 0
  
      # these are set via getters and setters so we can use a BaseManager which can be shared across processes
      self.checkpoint_save_function = None
      self.checkpoint_load_function = None
  
      # detect when this was called because a slurm object started a hopt.
      # if true, remove the flag so tt logs don't show it
      if hyperparam_optimizer is not None:
          self.is_from_slurm_object = (
              HyperOptArgumentParser.TRIGGER_CMD
              in vars(self.hyperparam_optimizer)
              and vars(self.hyperparam_optimizer)[
                  HyperOptArgumentParser.TRIGGER_CMD
              ]
              == True
          )
          if self.is_from_slurm_object:
              self.hyperparam_optimizer.__delattr__(
                  HyperOptArgumentParser.TRIGGER_CMD
              )
  
          self.call_load_checkpoint = (
              HyperOptArgumentParser.SLURM_LOAD_CMD
              in vars(self.hyperparam_optimizer)
          )
          if self.call_load_checkpoint:
              self.hyperparam_optimizer.__delattr__(
                  HyperOptArgumentParser.SLURM_LOAD_CMD
              )
  
          self.hpc_exp_number = self.hyperparam_optimizer.hpc_exp_number
  
imports: import datetime
  import os
  import signal
  import sys
  import time
  import traceback
  from subprocess import call
  from .argparse_hopt import HyperOptArgumentParser
label_desc: Use image node_id 1 to create a new AbstractCluster object from inherited base classes: object with example: obj = AbstractCluster(hyperparam_optimizer, log_path, python_cmd, enable_log_err, enable_log_out)