code: def get_terminal_size():
      """
      Detect terminal size and return tuple = (width, height).
  
      Only to be used when running in a terminal. Note that the IPython notebook,
      IPython zmq frontends, or IDLE do not run in a terminal,
      """
      import platform
  
      if PY3:
          return shutil.get_terminal_size()
  
      current_os = platform.system()
      tuple_xy = None
      if current_os == "Windows":
          tuple_xy = _get_terminal_size_windows()
          if tuple_xy is None:
              tuple_xy = _get_terminal_size_tput()
              # needed for window's python in cygwin's xterm!
      if (
          current_os == "Linux"
          or current_os == "Darwin"
          or current_os.startswith("CYGWIN")
      ):
          tuple_xy = _get_terminal_size_linux()
      if tuple_xy is None:
          tuple_xy = (80, 25)  # default value
      return tuple_xy
  
file_path: catboost/contrib/python/pandas/py2/pandas/io/formats/terminal.py
imports: from __future__ import print_function
  import os
  import shutil
  import subprocess
  from pandas.compat import PY3
label_desc: Use image node_id 1 for calling a global function with example usage: get_terminal_size() and returns: tuple_xy, shutil