def _repr_fits_horizontal_(self, ignore_width=False):
width, height = console.get_console_size()<EOL>max_columns = get_option("<STR_LIT>")<EOL>nb_columns = len(self.columns)<EOL>if ((max_columns and nb_columns > max_columns) or<EOL>((not ignore_width) and width and nb_columns > (width // <NUM_LIT:2>))):<EOL><INDENT>return False<EOL><DEDENT>if ignore_width or not console.in_interactive_session():<EOL><INDENT>return True<EOL><DEDENT>if (get_option('<STR_LIT>') is not None or<EOL>console.in_ipython_frontend()):<EOL><INDENT>max_rows = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>max_rows = get_option("<STR_LIT>")<EOL><DEDENT>buf = StringIO()<EOL>d = self<EOL>if not (max_rows is None):  <EOL><INDENT>d = d.iloc[:min(max_rows, len(d))]<EOL><DEDENT>else:<EOL><INDENT>return True<EOL><DEDENT>d.to_string(buf=buf)<EOL>value = buf.getvalue()<EOL>repr_width = max(len(l) for l in value.split('<STR_LIT:\n>'))<EOL>return repr_width < width<EOL>
Check if full repr fits in horizontal boundaries imposed by the display
options width and max_columns.

In case off non-interactive session, no boundaries apply.

`ignore_width` is here so ipnb+HTML output can behave the way
users expect. display.max_columns remains in effect.
GH3541, GH3573