code: def _test__native_dist_model_create_from_backend_slurm(
      local_rank, rank, world_size, backend, true_device
  ):
      import os
      from datetime import timedelta
  
      timeout = timedelta(seconds=20)
  
      assert "MASTER_ADDR" not in os.environ
      assert "MASTER_PORT" not in os.environ
  
      del os.environ["WORLD_SIZE"]
      del os.environ["LOCAL_RANK"]
  
      os.environ["SLURM_JOB_ID"] = "15000"
      os.environ["SLURM_PROCID"] = str(rank)
      os.environ["SLURM_LOCALID"] = str(local_rank)
      os.environ["SLURM_NTASKS"] = str(world_size)
      os.environ["SLURM_JOB_NODELIST"] = "localhost"
      os.environ["SLURM_JOB_NUM_NODES"] = "1"
  
      model = _NativeDistModel.create_from_backend(
          backend=backend, timeout=timeout
      )
  
      assert dist.is_available() and dist.is_initialized()
      assert dist.get_backend() == backend
  
      with pytest.raises(
          RuntimeError,
          match=r"Can not create new distributed process group if default one is",
      ):
          _NativeDistModel.create_from_backend(
              backend=backend, timeout=timeout
          )
  
      _assert_model(
          model,
          {
              "device": true_device,
              "local_rank": local_rank,
              "rank": rank,
              "world_size": world_size,
              "node_index": 0,
              "nnodes": 1,
              "nproc_per_node": world_size,
          },
      )
  
      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"]
  
      assert "MASTER_ADDR" not in os.environ
      assert "MASTER_PORT" not in os.environ
      assert "RANK" not in os.environ
  
      os.environ["WORLD_SIZE"] = str(world_size)
      os.environ["LOCAL_RANK"] = str(local_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 10 for calling a global function with example usage: _test__native_dist_model_create_from_backend_slurm(local_rank, rank, world_size, backend, true_device) without return types