# Path: harpoon/dockerpty/io.py
# def set_blocking(fd, blocking=True):
# def select(read_streams, write_streams, timeout=0):
#     def __init__(self, fd):
#     def fileno(self):
#     def set_blocking(self, value):
#     def read(self, n=4096):
#     def write(self, data):
#     def do_write(self):
#     def needs_write(self):
#     def close(self):
#     def __repr__(self):
#     def __init__(self, stream):
#     def fileno(self):
#     def set_blocking(self, value):
#     def read(self, n=4096):
#     def write(self, data):
#     def needs_write(self):
#     def do_write(self):
#     def close(self):
#     def _next_packet_size(self, n=0):
#     def __repr__(self):
#     def __init__(self, from_stream, to_stream, wait_for_output=True, propagate_close=True):
#     def fileno(self):
#     def set_blocking(self, value):
#     def flush(self, n=4096):
#     def is_done(self):
#     def __repr__(self):
# class Stream(object):
# class Demuxer(object):
# class Pump(object):
#     ERRNO_RECOVERABLE = [errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK]
# 
# Path: harpoon/dockerpty/tty.py
# def size(fd):
#     def __init__(self, fd, raw=True):
#     def __enter__(self):
#     def __exit__(self, *_):
#     def israw(self):
#     def start(self):
#     def stop(self):
#     def __repr__(self):
# class Terminal(object):


import sys
import signal
from ssl import SSLError
from harpoon.dockerpty import io
from harpoon.dockerpty import tty
        return map(attach_socket, ("stdin", "stdout", "stderr"))

    def resize(self, size=None):
        """
        Resize the container's PTY.

        If `size` is not None, it must be a tuple of (height,width), otherwise
        it will be determined by the size of the current TTY.
        """

        if not self.israw():
            return

        size = size or tty.size(self.stdout)

        if size is not None:
            rows, cols = size
            try:
                self.client.resize(self.container, height=rows, width=cols)
            except IOError:  # Container already exited
                pass

    def container_info(self):
        """
        Thin wrapper around client.inspect_container().
        """

        return self.client.inspect_container(self.container)

    def _hijack_tty(self, pumps):

# Path: harpoon/dockerpty/io.py
# def set_blocking(fd, blocking=True):
# def select(read_streams, write_streams, timeout=0):
#     def __init__(self, fd):
#     def fileno(self):
#     def set_blocking(self, value):
#     def read(self, n=4096):
#     def write(self, data):
#     def do_write(self):
#     def needs_write(self):
#     def close(self):
#     def __repr__(self):
#     def __init__(self, stream):
#     def fileno(self):
#     def set_blocking(self, value):
#     def read(self, n=4096):
#     def write(self, data):
#     def needs_write(self):
#     def do_write(self):
#     def close(self):
#     def _next_packet_size(self, n=0):
#     def __repr__(self):
#     def __init__(self, from_stream, to_stream, wait_for_output=True, propagate_close=True):
#     def fileno(self):
#     def set_blocking(self, value):
#     def flush(self, n=4096):
#     def is_done(self):
#     def __repr__(self):
# class Stream(object):
# class Demuxer(object):
# class Pump(object):
#     ERRNO_RECOVERABLE = [errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK]
# 
# Path: harpoon/dockerpty/tty.py
# def size(fd):
#     def __init__(self, fd, raw=True):
#     def __enter__(self):
#     def __exit__(self, *_):
#     def israw(self):
#     def start(self):
#     def stop(self):
#     def __repr__(self):
# class Terminal(object):


# Path: harpoon/dockerpty/pty.py
import sys
import signal
from ssl import SSLError
from harpoon.dockerpty import io
from harpoon.dockerpty import tty

        return map(attach_socket, ("stdin", "stdout", "stderr"))

    def resize(self, size=None):
        """
        Resize the container's PTY.

        If `size` is not None, it must be a tuple of (height,width), otherwise
        it will be determined by the size of the current TTY.
        """

        if not self.israw():
            return

        size = size or tty.size(self.stdout)

        if size is not None:
            rows, cols = size
            try:
                self.client.resize(self.container, height=rows, width=cols)
            except IOError:  # Container already exited
                pass

    def container_info(self):
        """
        Thin wrapper around client.inspect_container().
        """

        return self.client.inspect_container(self.container)

    def _hijack_tty(self, pumps):

        with tty.Terminal(self.stdin, raw=self.israw()):