code: def test__native_dist_model_create_from_backend_bad_slurm_config():
      import os
      from datetime import timedelta
  
      os.environ["SLURM_JOB_ID"] = "1"
  
      with pytest.raises(
          RuntimeError,
          match=r"SLURM distributed configuration is missing",
      ):
          _NativeDistModel.create_from_backend(
              backend="gloo", timeout=timedelta(seconds=10)
          )
  
      with pytest.raises(
          ValueError,
          match=r"Arguments rank and world_size should not be specified with SLURM",
      ):
          _NativeDistModel.create_from_backend(
              backend="gloo",
              timeout=timedelta(seconds=10),
              rank=1,
              init_method="",
              world_size=1,
          )
  
      os.environ["SLURM_PROCID"] = "0"
      os.environ["SLURM_LOCALID"] = "0"
      os.environ["SLURM_NTASKS"] = "1"
      os.environ["SLURM_JOB_NODELIST"] = "localhost"
      os.environ["SLURM_JOB_NUM_NODES"] = "1"
  
      os.environ["RANK"] = "1"
  
      with pytest.warns(
          UserWarning, match=r"We detected the following env variables"
      ):
          model = _NativeDistModel.create_from_backend(
              backend="gloo", timeout=timedelta(seconds=10)
          )
          model.finalize()
  
      del os.environ["SLURM_JOB_ID"]
      del os.environ["SLURM_PROCID"]
      del os.environ["SLURM_LOCALID"]
      del os.environ["SLURM_NTASKS"]
      del os.environ["SLURM_JOB_NODELIST"]
      del os.environ["SLURM_JOB_NUM_NODES"]
      del os.environ["RANK"]
  
imports: import os
  import pytest
  import torch
  import torch.distributed
  from ignite.distributed.comp_models import has_native_dist_support
label_desc: Use image node_id 6 for calling a global function with example usage: test__native_dist_model_create_from_backend_bad_slurm_config() without return types