code: def master_only(func):
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          rank, _ = get_dist_info()
          if rank == 0:
              return func(*args, **kwargs)
  
      return wrapper
  
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 6 for calling a global function with example usage: master_only(func) and returns: wrapper, func