code: def init_options(self):
      if self.distributed:
          if self.dist_init_method == "env://":
              if (
                  get_master_addr(
                      self.dist_master_addr, self.dist_launcher
                  )
                  is None
              ):
                  raise RuntimeError(
                      "--dist_master_addr or MASTER_ADDR must be set "
                      "if --dist_init_method == 'env://'"
                  )
              if get_master_port(self.dist_master_port) is None:
                  raise RuntimeError(
                      "--dist_master_port or MASTER_PORT must be set "
                      "if --dist_init_port == 'env://'"
                  )
  
          # About priority order:
          # If --dist_* is specified:
          #    Use the value of --dist_rank and overwrite it environ just in case.
          # elif environ is set:
          #    Use the value of environ and set it to self
          self.dist_rank = get_rank(self.dist_rank, self.dist_launcher)
          self.dist_world_size = get_world_size(
              self.dist_world_size, self.dist_launcher
          )
          self.local_rank = get_local_rank(
              self.local_rank, self.dist_launcher
          )
  
          if self.local_rank is not None:
              if self.ngpu > 1:
                  raise RuntimeError(
                      f"Assuming 1GPU in this case: ngpu={self.ngpu}"
                  )
              if "CUDA_VISIBLE_DEVICES" in os.environ:
                  cvd = os.environ["CUDA_VISIBLE_DEVICES"]
                  if self.local_rank >= len(cvd.split(",")):
                      raise RuntimeError(
                          f"LOCAL_RANK={self.local_rank} is bigger "
                          f"than the number of visible devices: {cvd}"
                      )
  
          if (
              self.dist_rank is not None
              and self.dist_world_size is not None
              and self.dist_rank >= self.dist_world_size
          ):
              raise RuntimeError(
                  f"RANK >= WORLD_SIZE: {self.dist_rank} >= {self.dist_world_size}"
              )
  
          if self.dist_init_method == "env://":
              self.dist_master_addr = get_master_addr(
                  self.dist_master_addr, self.dist_launcher
              )
              self.dist_master_port = get_master_port(
                  self.dist_master_port
              )
              if (
                  self.dist_master_addr is not None
                  and self.dist_master_port is not None
              ):
                  self.dist_init_method = f"tcp://{self.dist_master_addr}:{self.dist_master_port}"
  
imports: import dataclasses
  import os
  import socket
  from typing import Optional
  import torch
  import torch.distributed
label_desc: Use image node_id 1 for calling the DistributedOption obj's underlying member method code with example usage: obj.init_options() without return types