code: def get_terminal_width() -> int:
      width, _ = shutil.get_terminal_size(fallback=(80, 24))
  
      # The Windows get_terminal_size may be bogus, let's sanify a bit.
      if width < 40:
          width = 80
  
      return width
  
imports: import os
  import shutil
  import sys
  from typing import Optional
  from typing import Sequence
  from typing import TextIO
  from .wcwidth import wcswidth
  from _pytest.compat import final
label_desc: Use image node_id 1 for calling a global function with example usage: get_terminal_width() and returns: width