class_docstr: BaseProgressIndicator(name)
  
  A progress indicator helps display the progress of a task to the
  user. Progress can be pending, running, finished or failed.
  
  Each task has:
    * a name - a short description of what needs to be done.
    * an action - the current action in performing the task (e.g. a subtask)
    * progress - how far the task is completed
    * max - max number of progress units. If 0, the progress is indefinite
    * unit - the units in which the progress is counted
    * status - 0: pending, 1: in progress, 2: finished, 3: failed
  
  This class defines an abstract interface. Subclasses should implement
  _start, _stop, _update_progress(progressText), _write(message).
class_docstr_tok: ["BaseProgressIndicator","(","name",")","A","progress","indicator","helps","display","the","progress","of","a","task","to","the","user",".","Progress","can","be","pending",",","running",",","finished","or","failed",".","Each","task","has",":","*","a","name","-","a","short","description","of","what","needs","to","be","done",".","*","an","action","-","the","current","action","in","performing","the","task","(","e.g",".","a","subtask",")","*","progress","-","how","far","the","task","is","completed","*","max","-","max","number","of","progress","units",".","If","0",",","the","progress","is","indefinite","*","unit","-","the","units","in","which","the","progress","is","counted","*","status","-","0",":","pending",",","1",":","in","progress",",","2",":","finished",",","3",":","failed","This","class","defines","an","abstract","interface",".","Subclasses","should","implement","_start",",","_stop",",","_update_progress","(","progressText",")",",","_write","(","message",")","."]
docstr: set_progress(progress=0, force=False)
  
  Set the current progress. To avoid unnecessary progress updates
  this will only have a visual effect if the time since the last
  update is > 0.1 seconds, or if force is True.
docstr_tok: ["set_progress","(","progress=0",",","force=False",")","Set","the","current","progress",".","To","avoid","unnecessary","progress","updates","this","will","only","have","a","visual","effect","if","the","time","since","the","last","update","is",">","0.1","seconds",",","or","if","force","is","True","."]
code: def set_progress(self, progress=0, force=False):
      """set_progress(progress=0, force=False)
  
      Set the current progress. To avoid unnecessary progress updates
      this will only have a visual effect if the time since the last
      update is > 0.1 seconds, or if force is True.
      """
      self._progress = progress
      # Update or not?
      if not (
          force or (time.time() - self._last_progress_update > 0.1)
      ):
          return
      self._last_progress_update = time.time()
      # Compose new string
      unit = self._unit or ""
      progressText = ""
      if unit == "%":
          progressText = "%2.1f%%" % progress
      elif self._max > 0:
          percent = 100 * float(progress) / self._max
          progressText = "%i/%i %s (%2.1f%%)" % (
              progress,
              self._max,
              unit,
              percent,
          )
      elif progress > 0:
          if isinstance(progress, float):
              progressText = "%0.4g %s" % (progress, unit)
          else:
              progressText = "%i %s" % (progress, unit)
      # Update
      self._update_progress(progressText)
  
imports: from collections import OrderedDict
  import numpy
  import os
  import re
  import struct
  import sys
  import time
  import logging
label_desc: Use image node_id 4 for calling the BaseProgressIndicator obj's underlying member method code with example usage: obj.set_progress(progress, force) without return types