code: def _download(url, path, md5sum=None):
      """
      Download from url, save to path.
  
      url (str): download url
      path (str): download to given path
      """
      must_mkdirs(path)
  
      fname = osp.split(url)[-1]
      fullname = osp.join(path, fname)
      retry_cnt = 0
  
      while not (
          osp.exists(fullname)
          and _check_exist_file_md5(fullname, md5sum, url)
      ):
          if retry_cnt < DOWNLOAD_RETRY_LIMIT:
              retry_cnt += 1
          else:
              raise RuntimeError(
                  "Download from {} failed. "
                  "Retry limit reached".format(url)
              )
  
          logger.info("Downloading {} from {}".format(fname, url))
  
          # NOTE: windows path join may incur \, which is invalid in url
          if sys.platform == "win32":
              url = url.replace("\\", "/")
  
          req = requests.get(url, stream=True)
          if req.status_code != 200:
              raise RuntimeError(
                  "Downloading from {} failed with code "
                  "{}!".format(url, req.status_code)
              )
  
          # For protecting download interupted, download to
          # tmp_fullname firstly, move tmp_fullname to fullname
          # after download finished
          tmp_fullname = fullname + "_tmp"
          total_size = req.headers.get("content-length")
          with open(tmp_fullname, "wb") as f:
              if total_size:
                  for chunk in tqdm.tqdm(
                      req.iter_content(chunk_size=1024),
                      total=(int(total_size) + 1023) // 1024,
                      unit="KB",
                  ):
                      f.write(chunk)
              else:
                  for chunk in req.iter_content(chunk_size=1024):
                      if chunk:
                          f.write(chunk)
          shutil.move(tmp_fullname, fullname)
      return fullname
  
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 11 for calling a global function with example usage: _download(url, path, md5sum) and returns: fullname