code: def get_dist_info():
      if dist.is_available() and dist.is_initialized():
          rank = dist.get_rank()
          world_size = dist.get_world_size()
      else:
          rank = 0
          world_size = 1
      return rank, world_size
  
file_path: lavis/lavis/common/annotator/uniformer/mmcv/runner/dist_utils.py
imports: import functools
  import os
  import subprocess
  from collections import OrderedDict
  import torch
  import torch.multiprocessing
  from torch import distributed
  from torch._utils import _flatten_dense_tensors, _take_tensors, _unflatten_dense_tensors
label_desc: Use image node_id 5 for calling a global function with example usage: get_dist_info() and returns: rank,  world_size