def METHOD_NAME(fd):
    try:
        import fcntl
        import termios
        import struct
        cr = struct.unpack_from(
            'hh',
            fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
        )
    except Exception:
        return None
    if cr == (0, 0):
        return None
    return cr