class_docstr: Cluster environment for training on a cluster managed by SLURM.
  
  You can configure the `main_address` and `main_port` properties via the env variables `MASTER_ADDR` and
  `MASTER_PORT`, respectively.
  
  Args:
      auto_requeue: Whether automatic job resubmission is enabled or not. How and under which conditions a job gets
          rescheduled gets determined by the owner of this plugin.
      requeue_signal: The signal that SLURM will send to indicate that the job should be requeued. Defaults to
          SIGUSR1 on Unix.
class_docstr_tok: ["Cluster","environment","for","training","on","a","cluster","managed","by","SLURM",".","You","can","configure","the","`","main_address","`","and","`","main_port","`","properties","via","the","env","variables","`","MASTER_ADDR","`","and","`","MASTER_PORT","`",",","respectively",".","Args",":","auto_requeue",":","Whether","automatic","job","resubmission","is","enabled","or","not",".","How","and","under","which","conditions","a","job","gets","rescheduled","gets","determined","by","the","owner","of","this","plugin",".","requeue_signal",":","The","signal","that","SLURM","will","send","to","indicate","that","the","job","should","be","requeued",".","Defaults","to","SIGUSR1","on","Unix","."]
code: def validate_settings(self, num_devices: int, num_nodes: int) -> None:
      if _is_slurm_interactive_mode():
          return
      ntasks_per_node = os.environ.get("SLURM_NTASKS_PER_NODE")
      if (
          ntasks_per_node is not None
          and int(ntasks_per_node) != num_devices
      ):
          raise ValueError(
              f"You set `devices={num_devices}` in Lightning, but the number of tasks per node configured in SLURM"
              f" `--ntasks-per-node={ntasks_per_node}` does not match. HINT: Set `devices={ntasks_per_node}`."
          )
      nnodes = os.environ.get("SLURM_NNODES")
      if nnodes is not None and int(nnodes) != num_nodes:
          raise ValueError(
              f"You set `num_nodes={num_nodes}` in Lightning, but the number of nodes configured in SLURM"
              f" `--nodes={nnodes}` does not match. HINT: Set `num_nodes={nnodes}`."
          )
  
imports: import logging
  import os
  import re
  import shutil
  import signal
  import sys
  from typing import Optional
  from typing_extensions import override
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
  from lightning.fabric.utilities.imports import _IS_WINDOWS
  from lightning.fabric.utilities.rank_zero import rank_zero_warn
  from lightning.fabric.utilities.warnings import PossibleUserWarning
label_desc: Use image node_id 14 for calling the SLURMEnvironment obj's underlying member method code with example usage: obj.validate_settings(num_devices, num_nodes) without return types