# Path: paramiko/py3compat.py
# def byte_chr(c):
#     assert isinstance(c, int)
#     return struct.pack("B", c)
# 
# PY2 = sys.version_info[0] < 3
# 
# class long(int):
#     pass
# 
# def b(s, encoding="utf8"):  # NOQA
#     """cast unicode or bytes to bytes"""
#     if isinstance(s, str):
#         return s
#     elif isinstance(s, unicode):  # NOQA
#         return s.encode(encoding)
#     elif isinstance(s, buffer):  # NOQA
#         return s
#     else:
#         raise TypeError("Expected unicode or bytes, got {!r}".format(s))


import logging
from paramiko.py3compat import byte_chr, PY2, long, b
    OPEN_SUCCEEDED,
    OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED,
    OPEN_FAILED_CONNECT_FAILED,
    OPEN_FAILED_UNKNOWN_CHANNEL_TYPE,
    OPEN_FAILED_RESOURCE_SHORTAGE,
) = range(0, 5)


CONNECTION_FAILED_CODE = {
    1: "Administratively prohibited",
    2: "Connect failed",
    3: "Unknown channel type",
    4: "Resource shortage",
}


(
    DISCONNECT_SERVICE_NOT_AVAILABLE,
    DISCONNECT_AUTH_CANCELLED_BY_USER,
    DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE,
) = (7, 13, 14)

zero_byte = byte_chr(0)
one_byte = byte_chr(1)
four_byte = byte_chr(4)
max_byte = byte_chr(0xff)
cr_byte = byte_chr(13)
linefeed_byte = byte_chr(10)
crlf = cr_byte + linefeed_byte


# Path: paramiko/py3compat.py
# def byte_chr(c):
#     assert isinstance(c, int)
#     return struct.pack("B", c)
# 
# PY2 = sys.version_info[0] < 3
# 
# class long(int):
#     pass
# 
# def b(s, encoding="utf8"):  # NOQA
#     """cast unicode or bytes to bytes"""
#     if isinstance(s, str):
#         return s
#     elif isinstance(s, unicode):  # NOQA
#         return s.encode(encoding)
#     elif isinstance(s, buffer):  # NOQA
#         return s
#     else:
#         raise TypeError("Expected unicode or bytes, got {!r}".format(s))


# Path: paramiko/common.py
import logging
from paramiko.py3compat import byte_chr, PY2, long, b

    OPEN_SUCCEEDED,
    OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED,
    OPEN_FAILED_CONNECT_FAILED,
    OPEN_FAILED_UNKNOWN_CHANNEL_TYPE,
    OPEN_FAILED_RESOURCE_SHORTAGE,
) = range(0, 5)


CONNECTION_FAILED_CODE = {
    1: "Administratively prohibited",
    2: "Connect failed",
    3: "Unknown channel type",
    4: "Resource shortage",
}


(
    DISCONNECT_SERVICE_NOT_AVAILABLE,
    DISCONNECT_AUTH_CANCELLED_BY_USER,
    DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE,
) = (7, 13, 14)

zero_byte = byte_chr(0)
one_byte = byte_chr(1)
four_byte = byte_chr(4)
max_byte = byte_chr(0xff)
cr_byte = byte_chr(13)
linefeed_byte = byte_chr(10)
crlf = cr_byte + linefeed_byte


if PY2: