code: def _set_from_preset_env(self):
      # logger.info("Initialization from preset environment")
      self.master_addr = os.environ["MASTER_ADDR"]
      self.master_port = os.environ["MASTER_PORT"]
      self.rank = int(os.environ["RANK"])
      self.world_size = int(os.environ["WORLD_SIZE"])
      assert self.rank < self.world_size
      self.local_rank = int(os.environ["LOCAL_RANK"])
      self.local_world_size = int(os.environ["LOCAL_WORLD_SIZE"])
      assert self.local_rank < self.local_world_size
  
imports: import os
  import random
  import re
  import socket
  from typing import Dict, List
  import torch
  import torch.distributed
label_desc: Use image node_id 3 for calling the _TorchDistributedEnvironment obj's underlying member method code with example usage: obj._set_from_preset_env() without return types