code: def init_device(device, backend="nccl", host=None, port=None):
      os.environ["CUDA_VISIBLE_DEVICES"] = device
      if torch.cuda.device_count() > 1:
          host = host or os.environ.get("MASTER_ADDR", "localhost")
          port = port or os.environ.get(
              "MASTER_PORT", str(Random(0).randint(10000, 20000))
          )
          os.environ["MASTER_ADDR"] = host
          os.environ["MASTER_PORT"] = port
          dist.init_process_group(backend)
          torch.cuda.set_device(dist.get_rank())
  
file_path: underthesea/underthesea/utils/sp_parallel.py
imports: import os
  from random import Random
  import torch
  import torch.distributed
  import torch.nn
label_desc: Use image node_id 1 for calling a global function with example usage: init_device(device, backend, host, port) without return types