def get_terminal_size():
try:<EOL><INDENT>try:<EOL><INDENT>from shutil import get_terminal_size as _get_terminal_size  <EOL><DEDENT>except ImportError:<EOL><INDENT>from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size  <EOL><DEDENT>sz = _get_terminal_size()<EOL><DEDENT>except ValueError:<EOL><INDENT>"""<STR_LIT>"""<EOL>terminal_size = namedtuple('<STR_LIT>', '<STR_LIT>')<EOL>sz = terminal_size(<NUM_LIT>, <NUM_LIT>)<EOL><DEDENT>return sz<EOL>
Returns terminal dimensions
    :return: Returns ``(width, height)``.  If there's no terminal
             to be found, we'll just return ``(80, 24)``.