<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wandb_pty(resize=True):
 """Get a PTY set to raw mode and registered to hear about window size changes. """

    master_fd, slave_fd = pty.openpty()
    # raw mode so carriage returns etc. don't get added by the terminal driver,
    # bash for windows blows up on this so we catch the error and do nothing
    # TODO(adrian): (when) will this be called on windows?
    try:
        tty.setraw(master_fd)
    except termios.error:
        pass

    if resize:
        if SIGWINCH_HANDLER is not None:
            SIGWINCH_HANDLER.add_fd(master_fd)

    return master_fd, slave_fd