code: def _create_dist_context(dist_info, lrank):
      dist.init_process_group(**dist_info)
      dist.barrier()
      if torch.cuda.is_available():
          torch.cuda.set_device(lrank)
  
      return {
          "local_rank": lrank,
          "world_size": dist_info["world_size"],
          "rank": dist_info["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 8 for calling a global function with example usage: _create_dist_context(dist_info, lrank) and returns: dict