def get_console_size():
from pandas import get_option<EOL>display_width = get_option('<STR_LIT>')<EOL>display_height = get_option('<STR_LIT>')<EOL>if in_interactive_session():<EOL><INDENT>if in_ipython_frontend():<EOL><INDENT>from pandas._config.config import get_default_val<EOL>terminal_width = get_default_val('<STR_LIT>')<EOL>terminal_height = get_default_val('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>terminal_width, terminal_height = get_terminal_size()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>terminal_width, terminal_height = None, None<EOL><DEDENT>return (display_width or terminal_width, display_height or terminal_height)<EOL>
Return console size as tuple = (width, height).

    Returns (None,None) in non-interactive session.