code: def _progress(
      chunks_downloaded, chunk_size, total_size, part=1, total_parts=1
  ):
      """Reporthook for :func:`urllib.urlretrieve`, code from [1]_.
  
      Parameters
      ----------
      chunks_downloaded : int
          Number of chunks of data that have been downloaded.
      chunk_size : int
          Size of each chunk of data.
      total_size : int
          Total size of the dataset/model.
      part : int, optional
          Number of current part, used only if `no_parts` > 1.
      total_parts : int, optional
          Total number of parts.
  
  
      References
      ----------
      [1] https://gist.github.com/vladignatyev/06860ec2040cb497f0f3
  
      """
      bar_len = 50
      size_downloaded = float(chunks_downloaded * chunk_size)
      filled_len = int(
          math.floor((bar_len * size_downloaded) / total_size)
      )
      percent_downloaded = round(
          ((size_downloaded * 100) / total_size), 1
      )
      bar = "=" * filled_len + "-" * (bar_len - filled_len)
      if total_parts == 1:
          sys.stdout.write(
              "\r[%s] %s%s %s/%sMB downloaded"
              % (
                  bar,
                  percent_downloaded,
                  "%",
                  round(size_downloaded / (1024 * 1024), 1),
                  round(float(total_size) / (1024 * 1024), 1),
              )
          )
          sys.stdout.flush()
      else:
          sys.stdout.write(
              "\r Part %s/%s [%s] %s%s %s/%sMB downloaded"
              % (
                  part + 1,
                  total_parts,
                  bar,
                  percent_downloaded,
                  "%",
                  round(size_downloaded / (1024 * 1024), 1),
                  round(float(total_size) / (1024 * 1024), 1),
              )
          )
          sys.stdout.flush()
  
imports: from __future__ import absolute_import
  import argparse
  import os
  import io
  import json
  import logging
  import sys
  import errno
  import hashlib
  import math
  import shutil
  import tempfile
  from functools import partial
label_desc: Use image node_id 1 for calling a global function with example usage: _progress(chunks_downloaded, chunk_size, total_size, part, total_parts) without return types