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 about the character encoding of the underlying output stream.
  
  Some widgets may render differently depending on whether the output is unicode-aware or not. This function
  will be called on the widget before its first render, to tell the widget what the encoding will be. It is up
  to the widget whether to do anything with this information or simply ignore it (default).
  
  :param encoding: the encoding string, eg "utf-8" or "cp437".
docstr_tok: ["Inform","the","widget","about","the","character","encoding","of","the","underlying","output","stream",".","Some","widgets","may","render","differently","depending","on","whether","the","output","is","unicode-aware","or","not",".","This","function","will","be","called","on","the","widget","before","its","first","render",",","to","tell","the","widget","what","the","encoding","will","be",".","It","is","up","to","the","widget","whether","to","do","anything","with","this","information","or","simply","ignore","it","(","default",")",".",":","param","encoding",":","the","encoding","string",",","eg","``","utf-8","''","or","``","cp437","''","."]
code: def set_encoding(self, encoding):
      """
      Inform the widget about the character encoding of the underlying output stream.
  
      Some widgets may render differently depending on whether the output is unicode-aware or not. This function
      will be called on the widget before its first render, to tell the widget what the encoding will be. It is up
      to the widget whether to do anything with this information or simply ignore it (default).
  
      :param encoding: the encoding string, eg "utf-8" or "cp437".
      """
      assert_is_type(encoding, str)
  
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 3 for calling the ProgressBarWidget obj's underlying member method code with example usage: obj.set_encoding(encoding) without return types