code: def local_rank(worker_id):
      """use a different account in each xdist worker"""
  
      if "gw" in worker_id:
          lrank = int(worker_id.replace("gw", ""))
      elif "master" == worker_id:
          lrank = 0
      else:
          raise RuntimeError(
              f"Can not get rank from worker_id={worker_id}"
          )
  
      os.environ["LOCAL_RANK"] = f"{lrank}"
  
      yield lrank
  
      del os.environ["LOCAL_RANK"]
  
imports: import functools
  import os
  import shutil
  import sys
  import tempfile
  import time
  from pathlib import Path
  import pytest
  import torch
  import torch.distributed
  import ignite.distributed
label_desc: Use image node_id 5 for calling a global function with example usage: local_rank(worker_id) without return types