class_docstr: The widget that looks like an actual progress bar.
  
  It renders differently depending on whether the output supports Unicode or not:
      |███████   |  or
      [#######   ]
class_docstr_tok: ["The","widget","that","looks","like","an","actual","progress","bar",".","It","renders","differently","depending","on","whether","the","output","supports","Unicode","or","not",":","|\u2588\u2588\u2588\u2588\u2588\u2588\u2588","|","or","[","#","#","#","#","#","#","#","]"]
docstr: Inform the widget about the encoding of the underlying character stream.
docstr_tok: ["Inform","the","widget","about","the","encoding","of","the","underlying","character","stream","."]
code: def set_encoding(self, encoding):
      """Inform the widget about the encoding of the underlying character stream."""
      self._bar_ends = "[]"
      self._bar_symbols = "#"
      if not encoding:
          return
      s1 = "\u258F\u258E\u258D\u258C\u258B\u258A\u2589\u2588"
      s2 = "\u258C\u2588"
      s3 = "\u2588"
      if self._file_mode:
          s1 = s2 = None
      assert len(s3) == 1
      for s in (s1, s2, s3):
          if s is None:
              continue
          try:
              s.encode(encoding)
              self._bar_ends = "||"
              self._bar_symbols = s
              return
          except UnicodeEncodeError:
              pass
          except LookupError:
              print("Warning: unknown encoding %s" % encoding)
  
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 PBWBar obj's underlying member method code with example usage: obj.set_encoding(encoding) without return types