code: def _test_idist_methods_in_native_context_set_local_rank(
      backend, device, local_rank
  ):
      # We explicitly set _model as _SerialModel
      # then call idist.* methods and check that they give correct values
      from ignite.distributed.utils import _SerialModel, _set_model
  
      _set_model(_SerialModel())
  
      lrank = int(os.environ["LOCAL_RANK"])
      del os.environ["LOCAL_RANK"]
  
      ws = dist.get_world_size()
      rank = dist.get_rank()
  
      idist.set_local_rank(local_rank)
  
      _test_distrib_config(
          local_rank=local_rank,
          backend=backend,
          ws=ws,
          true_device=device,
          rank=rank,
      )
  
      os.environ["LOCAL_RANK"] = str(lrank)
  
imports: import os
  import pytest
  import torch
  import torch.distributed
  from packaging.version import Version
  import ignite.distributed
  from ignite.distributed.utils import has_native_dist_support
  from tests.ignite.distributed.utils import _test_distrib__get_max_length, _test_distrib_all_gather, _test_distrib_all_gather_group, _test_distrib_all_reduce, _test_distrib_all_reduce_group, _test_distrib_barrier, _test_distrib_broadcast, _test_distrib_config, _test_distrib_new_group, _test_distrib_one_rank_only, _test_distrib_one_rank_only_with_engine, _test_sync
label_desc: Use image node_id 14 for calling a global function with example usage: _test_idist_methods_in_native_context_set_local_rank(backend, device, local_rank) without return types