class_docstr: This class provides interface functions for users to get the parallel context,
  such as the global rank, the local rank, the world size, etc. of each device.
  
  Note:
      The parallel_mode used in this class should be concluded in ``ParallelMode``.
      More details about ``ParallelMode`` could be found in
      `parallel_mode <https://github.com/hpcaitech/ColossalAI/blob/main/colossalai/context/parallel_mode.py>`_.
code: def __init__(self):
      # distributed settings
      self._global_ranks = dict()
      self._local_ranks = dict()
      self._world_sizes = dict()
      self._groups = dict()
      self._cpu_groups = dict()
      self._ranks_in_group = dict()
  
      # load config from file
      self._config = None
  
      # default 3D parallel args, will be overwritten during process group initialization
      self.world_size = 1
      self.data_parallel_size = 1
      self.pipeline_parallel_size = 1
      self.tensor_parallel_size = 1
      self.num_processes_on_current_node = -1
      self.virtual_pipeline_parallel_size = None
      self.virtual_pipeline_parallel_rank = None
  
      # logging
      self._verbose = False
      self._logger = None
  
imports: import random
  import socket
  from collections import Counter
  from typing import Union
  import numpy
  import torch
  import torch.distributed
  from colossalai.context.config import Config
  from colossalai.context.singleton_meta import SingletonMeta
  from colossalai.legacy.constants import ALLOWED_MODES, INITIALIZER_MAPPING
  from colossalai.legacy.global_variables import tensor_parallel_env
  from colossalai.legacy.registry import DIST_GROUP_INITIALIZER
  from colossalai.logging import get_dist_logger
  from .parallel_mode import ParallelMode
  from .random import add_seed, get_seeds, set_mode
label_desc: Use image node_id 1 to create a new ParallelContext object  with example: obj = ParallelContext()