def columns():
    if 'COLUMNS' in os.environ:
        return int(os.environ['COLUMNS'])

    if not sys.stdout.isatty():
        return DEFAULT_TERM_COLUMNS

    try:
        win = curses.initscr()
        _, cols = win.getmaxyx()
        curses.endwin()
        return cols
    except:
        return DEFAULT_TERM_COLUMNS
Flush the file to the database.
dataset/ETHPy150Open signalfx/maestro-ng/maestro/termoutput.py/columns--crossover with--dataset/ETHPy150Open twisted/txmongo/txmongo/_gridfs/grid_file.py/GridIn.__flush