def set_terminal_size(stdout_fileno, rows, cols):
    # Buffer for the C call
    # (The first parameter of 'array.array' needs to be 'str' on both Python 2
    # and Python 3.)
    buf = array.array(str('h'), [rows, cols, 0, 0])

    # Do: TIOCSWINSZ (Set)
    fcntl.ioctl(stdout_fileno, termios.TIOCSWINSZ, buf)
Checks if contrib.sites is installed and returns either the current
dataset/ETHPy150Open jonathanslenders/pymux/pymux/utils.py/set_terminal_size--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/contrib/sites/models.py/get_current_site