code: def get_terminal_size():
      """Returns the current size of the terminal as tuple in the form
      ``(width, height)`` in columns and rows.
      """
      # If shutil has get_terminal_size() (Python 3.3 and later) use that
      if sys.version_info >= (3, 3):
          import shutil
  
          shutil_get_terminal_size = getattr(
              shutil, "get_terminal_size", None
          )
          if shutil_get_terminal_size:
              sz = shutil_get_terminal_size()
              return sz.columns, sz.lines
  
      # We provide a sensible default for get_winterm_size() when being invoked
      # inside a subprocess. Without this, it would not provide a useful input.
      if get_winterm_size is not None:
          size = get_winterm_size()
          if size == (0, 0):
              return (79, 24)
          else:
              return size
  
      def ioctl_gwinsz(fd):
          try:
              import fcntl
              import termios
  
              cr = struct.unpack(
                  "hh", fcntl.ioctl(fd, termios.TIOCGWINSZ, "1234")
              )
          except Exception:
              return
          return cr
  
      cr = ioctl_gwinsz(0) or ioctl_gwinsz(1) or ioctl_gwinsz(2)
      if not cr:
          try:
              fd = os.open(os.ctermid(), os.O_RDONLY)
              try:
                  cr = ioctl_gwinsz(fd)
              finally:
                  os.close(fd)
          except Exception:
              pass
      if not cr or not cr[0] or not cr[1]:
          cr = (
              os.environ.get("LINES", 25),
              os.environ.get("COLUMNS", DEFAULT_COLUMNS),
          )
      return int(cr[1]), int(cr[0])
  
imports: import inspect
  import io
  import itertools
  import os
  import struct
  import sys
  from ._compat import DEFAULT_COLUMNS
  from ._compat import get_winterm_size
  from ._compat import isatty
  from ._compat import raw_input
  from ._compat import string_types
  from ._compat import strip_ansi
  from ._compat import text_type
  from ._compat import WIN
  from .exceptions import Abort
  from .exceptions import UsageError
  from .globals import resolve_color_default
  from .types import Choice
  from .types import convert_type
  from .types import Path
  from .utils import echo
  from .utils import LazyFile
label_desc: Use image node_id 6 for calling a global function with example usage: get_terminal_size() and returns: int,  int, cr, sz,  sz, int,  int, size