code: def _download_dist(url, path, md5sum=None):
      env = os.environ
      if "PADDLE_TRAINERS_NUM" in env and "PADDLE_TRAINER_ID" in env:
          # Mainly used to solve the problem of downloading data from
          # different machines in the case of multiple machines.
          # Different nodes will download data, and the same node
          # will only download data once.
          # Reference https://github.com/PaddlePaddle/PaddleClas/blob/develop/ppcls/utils/download.py#L108
          rank_id_curr_node = int(
              os.environ.get("PADDLE_RANK_IN_NODE", 0)
          )
          num_trainers = int(env["PADDLE_TRAINERS_NUM"])
          if num_trainers <= 1:
              return _download(url, path, md5sum)
          else:
              fname = osp.split(url)[-1]
              fullname = osp.join(path, fname)
              lock_path = fullname + ".download.lock"
  
              must_mkdirs(path)
  
              if not osp.exists(fullname):
                  with open(lock_path, "w"):  # touch
                      os.utime(lock_path, None)
                  if rank_id_curr_node == 0:
                      _download(url, path, md5sum)
                      os.remove(lock_path)
                  else:
                      while os.path.exists(lock_path):
                          time.sleep(0.5)
              return fullname
      else:
          return _download(url, path, md5sum)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import os.path
  import sys
  import yaml
  import time
  import shutil
  import requests
  import tqdm
  import hashlib
  import base64
  import binascii
  import tarfile
  import zipfile
  import errno
  from paddle.utils.download import _get_unique_endpoints
  from ppdet.core.workspace import BASE_KEY
  from .logger import setup_logger
  from .voc_utils import create_list
label_desc: Use image node_id 12 for calling a global function with example usage: _download_dist(url, path, md5sum) and returns: _download, _download, fullname