class_docstr: Container for other widgets.
  
  This widget is designed for internal use only! Its role is to lay out all contained widgets.
class_docstr_tok: ["Container","for","other","widgets",".","This","widget","is","designed","for","internal","use","only","!","Its","role","is","to","lay","out","all","contained","widgets","."]
docstr: Find current STDOUT's width, in characters.
docstr_tok: ["Find","current","STDOUT","'s","width",",","in","characters","."]
code: def _get_terminal_size():
      """Find current STDOUT's width, in characters."""
      # If output is not terminal but a regular file, assume 100 chars width
      if not sys.stdout.isatty():
          return 80
  
      # Otherwise, first try getting the dimensions from shell command `stty`:
      try:
          import subprocess
  
          ret = (
              subprocess.check_output(["stty", "size"])
              .strip()
              .split(" ")
          )
          if len(ret) == 2:
              return int(ret[1])
      except:
          pass
  
      # Otherwise try using ioctl
      try:
          from termios import TIOCGWINSZ
          from fcntl import ioctl
          from struct import unpack
  
          res = unpack("hh", ioctl(sys.stdout, TIOCGWINSZ, b"1234"))
          return int(res[1])
      except:
          pass
  
      # Finally check the COLUMNS environment variable
      return int(os.environ.get("COLUMNS", 80))
  
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 _ProgressBarCompoundWidget obj's underlying member method code with example usage: obj._get_terminal_size() and returns: int, int, int, int