class_docstr: Base class for all progress bar widgets.
  
  The primary interface of this class is the ``render(progress)`` method, which requests the widget to render
  itself for the given progress level. The method returns a ``RenderResult`` object, consisting of: the rendered
  string itself, the next time moment when rendering should occur, or the next progress level at which the widget
  should be rerendered.
class_docstr_tok: ["Base","class","for","all","progress","bar","widgets",".","The","primary","interface","of","this","class","is","the","``","render","(","progress",")","``","method",",","which","requests","the","widget","to","render","itself","for","the","given","progress","level",".","The","method","returns","a","``","RenderResult","``","object",",","consisting","of",":","the","rendered","string","itself",",","the","next","time","moment","when","rendering","should","occur",",","or","the","next","progress","level","at","which","the","widget","should","be","rerendered","."]
docstr: Inform the widget that it will be rendered in either tty or file mode.
  
  This is only useful for widgets that support dual rendering mode.
  
  :param mode: either "tty" or "file".
docstr_tok: ["Inform","the","widget","that","it","will","be","rendered","in","either","tty","or","file","mode",".","This","is","only","useful","for","widgets","that","support","dual","rendering","mode",".",":","param","mode",":","either","``","tty","''","or","``","file","''","."]
code: def set_mode(self, mode):
      """
      Inform the widget that it will be rendered in either tty or file mode.
  
      This is only useful for widgets that support dual rendering mode.
  
      :param mode: either "tty" or "file".
      """
      assert_is_type(mode, "tty", "file")
      self._file_mode = mode == "file"
  
imports: from h2o.utils.compatibility import *
  import math
  import os
  import sys
  import time
  from types import FunctionType, GeneratorType, MethodType
  from h2o.utils.shared_utils import clamp
  from h2o.utils.typechecks import assert_is_type, is_type, numeric
label_desc: Use image node_id 4 for calling the ProgressBarWidget obj's underlying member method code with example usage: obj.set_mode(mode) without return types