code: def load_pavimodel_dist(model_path, map_location=None):
      """In distributed setting, this function only download checkpoint at local
      rank 0."""
      try:
          from pavi import modelcloud
      except ImportError:
          raise ImportError(
              "Please install pavi to load checkpoint from modelcloud."
          )
      rank, world_size = get_dist_info()
      rank = int(os.environ.get("LOCAL_RANK", rank))
      if rank == 0:
          model = modelcloud.get(model_path)
          with TemporaryDirectory() as tmp_dir:
              downloaded_file = osp.join(tmp_dir, model.name)
              model.download(downloaded_file)
              checkpoint = torch.load(
                  downloaded_file, map_location=map_location
              )
      if world_size > 1:
          torch.distributed.barrier()
          if rank > 0:
              model = modelcloud.get(model_path)
              with TemporaryDirectory() as tmp_dir:
                  downloaded_file = osp.join(tmp_dir, model.name)
                  model.download(downloaded_file)
                  checkpoint = torch.load(
                      downloaded_file, map_location=map_location
                  )
      return checkpoint
  
imports: import io
  import os
  import os.path
  import pkgutil
  import time
  import warnings
  from collections import OrderedDict
  from importlib import import_module
  from tempfile import TemporaryDirectory
  import torch
  import torchvision
  from torch.optim import Optimizer
  from torch.utils import model_zoo
  from torch.nn import functional
  import annotator.uniformer.mmcv
  from annotator.uniformer.mmcv.fileio import FileClient
  from annotator.uniformer.mmcv.fileio import load
  from annotator.uniformer.mmcv.parallel import is_module_wrapper
  from annotator.uniformer.mmcv.utils import mkdir_or_exist
  from annotator.uniformer.mmcv.runner import get_dist_info
label_desc: Use image node_id 4 for calling a global function with example usage: load_pavimodel_dist(model_path, map_location) and returns: checkpoint