human
I wrote the below code

    def ioctl_GWINSZ(fd):
        import fcntl
        import termios
        return struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
    for fd in (0, 1, 2):
        try:
            return ioctl_GWINSZ(fd)
        except:
            pass
    try:
        fd = os.open(os.ctermid(), os.O_RDONLY)
        try:
            return ioctl_GWINSZ(fd)
        finally:
            os.close(fd)
    except:
        pass
    try:
        process = subprocess.Popen(['stty', 'size'], shell=False, stdout=subprocess.PIPE, stderr=open(os.devnull, 'w'))
        result = process.communicate()
        if (process.returncode == 0):
            return tuple((int(x) for x in result[0].split()))
    except:
        pass
    try:
        return tuple((int(os.getenv(var)) for var in ('LINES', 'COLUMNS')))
    except:
        pass
    return default

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

def get_terminal_size(default=(80, 20)):