code: def _get_terminal_size_tput():
      # get terminal width
      # src: http://stackoverflow.com/questions/263890/how-do-i-find-the-width
      # -height-of-a-terminal-window
  
      try:
          proc = subprocess.Popen(
              ["tput", "cols"],
              stdin=subprocess.PIPE,
              stdout=subprocess.PIPE,
          )
          output_cols = proc.communicate(input=None)
          proc = subprocess.Popen(
              ["tput", "lines"],
              stdin=subprocess.PIPE,
              stdout=subprocess.PIPE,
          )
          output_rows = proc.communicate(input=None)
      except OSError:
          return None
  
      try:
          # Some terminals (e.g. spyder) may report a terminal size of '',
          # making the `int` fail.
  
          cols = int(output_cols[0])
          rows = int(output_rows[0])
          return cols, rows
      except (ValueError, IndexError):
          return None
  
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 4 for calling a global function with example usage: _get_terminal_size_tput() and returns: cols,  rows, None, None