human
I wrote the below code

    def ioctl_GWINSZ(fd):
        try:
            rc = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
        except:
            return
        return rc
    rc = (ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2))
    if (not rc):
        try:
            fd = os.open(os.ctermid(), os.O_RDONLY)
            rc = ioctl_GWINSZ(fd)
            os.close(fd)
        except:
            pass
    if (not rc):
        rc = (os.environ.get('LINES', 25), os.environ.get('COLUMNS', 80))
    return (int(rc[0]), int(rc[1]))

What's a good function header?
assistant
#Here's a good function header.

def terminal_size():