code: def update_progress(progress, info):
      """Display progress bar and user info.
  
      Args:
          progress (float): progress [0, 1], negative for halt, and >=1 for done.
          info (str): a string for user provided info to be displayed.
      """
      barLength = 20  # bar length
      status = ""
      if isinstance(progress, int):
          progress = float(progress)
      if not isinstance(progress, float):
          progress = 0
          status = "error: progress var must be float. "
      if progress < 0:
          progress = 0
          status = "Halt. "
      if progress >= 1:
          progress = 1
          status = "Done. "
      status = status + info
      block = int(round(barLength * progress))
      text = "[{0}] {1:3.1f}% {2}".format(
          "." * block + " " * (barLength - block),
          progress * 100,
          status,
      )
      sys.stdout.write(text)
      sys.stdout.write("\b" * (9 + barLength + len(status)))
      sys.stdout.flush()
  
file_path: singa/python/singa/utils.py
imports: import sys
  import numpy
  import collections
  from .None import singa_wrap
label_desc: Use image node_id 1 for calling a global function with example usage: update_progress(progress, info) without return types