HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/asyncssh/__pycache__/misc.cpython-310.pyc
o

�h6l�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZddl
mZddlmZddlmZmZmZmZmZddlmZmZmZmZmZmZddlmZmZmZm Z m!Z!m"Z"m#Z#dd	l$m%Z%m&Z&d
dl'm(Z(d
dl'm)Z)m*Z*d
d
l'm+Z+m,Z,d
dl'm-Z-m.Z.d
dl'm/Z/d
dl'm0Z0m1Z1d
dl'm2Z2dZ3e	j4dkr�zddl5Z5ddl6Z6ddl7Z7dZ3Wn	e8y�Ynwe	j4dkr�ddl9Z9ddl:Z:ddl;Z;ee<e<fZ=ee=Z>ee<e<e<e<fZ?e!dee<e<fe?fZ@Gdd�de&�ZAGdd�de&�ZBGdd�de&�ZCe d�ZDe!edeDfZEe!eDeeDfZFeeeGeGefZHe!eHedfZIe!eJeKfZLeeLeLfZMe!eKefZNeeKe<fZOe!ejPejQfZRe!ejSejTfZUe!eeKe<feeKe<e<e<ffZVeeLeLfZWeeeLeLfZXeeLZYee!eWeXeYfZZe�Z[e[j\Z\e�]d�Z^d
dd d!d"�Z_d
d
d#d$d%d&d'�Z`d(eZd)eeeJeJffd*d+�Zad,eYd)eeeJeJffd-d.�Zbd(eeJeJfd)eeeKeKffd/d0�Zcd�d2edd3eKd)eKfd4d5�Zed�d7e<d8eKd9eKd)eKfd:d;�Zfd<eedd)egfd=d>�Zh	d�d?eeKe<fd3eKd@e<d)ee<eKffdAdB�ZidCZjdDeKd)eKfdEdF�ZkdGeKd)eKfdHdI�ZldGeKd)eRfdJdK�ZmdGeKd)eUfdLdM�Znd�dOeNdPeKdQe<d)eeJfdRdS�Zoe#dOeNd)eJfdTdU��Zpe#dOeNdPe%dVd)eJfdWdU��Zpe#dOeNdPe%dXd)eKfdYdU��Zpd�dZdU�Zpd�dOeNd\eJdPeKd)e<fd]d^�Zqe	j4dk�r�e3�r�d_ed)dfd`da�Zrn	dbed)dfdcda�Zrd2eKddeeKe<fd8eKd)esfdedf�Ztd2eKd)e<fdgdh�Zud2eKd)esfdidj�ZvdkeKd)eeKfdldm�Zwe dneddo�ZxGdpdq�dqeex�ZyedreexfZzedreyexfZ{dsezexd)e{exfdtdu�Z|d�dwdx�Z}dyedreDfdzedd)eDfd{d|�Z~d}ed~e<de<d�e<d�e<d)dfd�d��ZGd�d��d��Z�Gd�d��d�e��Z�Gd�d��d�e�d��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�Gd�d��d�e��Z�e0e�e-e�e.e�e)e�e2e�e1e�e+e�e*e�e/e�e,e�i
Z�d�e<d�eKd�eKd)e�fd�d��Z�dS)�z+Miscellaneous utility classes and functions�N)�Path�PurePath)�SystemRandom)�
TracebackType)�Any�AsyncContextManager�	Awaitable�Callable�Dict)�	Generator�Generic�IO�Iterator�Mapping�Optional)�Sequence�Tuple�Type�TypeVar�Union�cast�overload)�Literal�Protocol�)�DEFAULT_LANG)�DISC_COMPRESSION_ERROR�DISC_CONNECTION_LOST)�DISC_HOST_KEY_NOT_VERIFIABLE�DISC_ILLEGAL_USER_NAME)�DISC_KEY_EXCHANGE_FAILED�DISC_MAC_ERROR)�#DISC_NO_MORE_AUTH_METHODS_AVAILABLE)�DISC_PROTOCOL_ERROR�#DISC_PROTOCOL_VERSION_NOT_SUPPORTED)�DISC_SERVICE_NOT_AVAILABLEF�win32Tc@steZdZdZedefdd��Zedefdd��Zedefdd��Z	de
fd	d
�Zdefdd�Zd
e
ddfdd�Z
dS)�_HashzProtocol for hashing data�returncC�dS)zReturn the hash digest sizeN���selfr*r*�C/usr/local/CyberPanel/lib/python3.10/site-packages/asyncssh/misc.py�digest_sizeJ�z_Hash.digest_sizecCr))zReturn the hash block sizeNr*r+r*r*r-�
block_sizeNr/z_Hash.block_sizecCr))zReturn the hash nameNr*r+r*r*r-�nameRr/z
_Hash.namecCr))z)Return the digest value as a bytes objectNr*r+r*r*r-�digestVr/z_Hash.digestcCr))z9Return the digest value as a string of hexadecimal digitsNr*r+r*r*r-�	hexdigestYr/z_Hash.hexdigest�_Hash__dataNcCr))z7Update this hash object's state with the provided bytesNr*)r,r4r*r*r-�update\r/z_Hash.update)�__name__�
__module__�__qualname__�__doc__�property�intr.r0�strr1�bytesr2r3r5r*r*r*r-r'Gsr'c@s$eZdZdZddedefdd�ZdS)	�HashTypez2Protocol for returning the type of a hash function.�_HashType__datar(cCr))zCreate a new hash objectNr*)r,r?r*r*r-�__call__cr/zHashType.__call__N).)r6r7r8r9r=r'r@r*r*r*r-r>`sr>c@seZdZdZddd�ZdS)�_SupportsWaitClosedz'A class that supports async wait_closedr(Nc�s�dS)zWait for transport to closeNr*r+r*r*r-�wait_closedjsz_SupportsWaitClosed.wait_closed�r(N)r6r7r8r9rBr*r*r*r-rAgsrA�_Tr*)NNNz
([A-Za-z])iii@)��k�m�g�<ii�Qi�:	)rE�srG�h�d�w�envr(c
cs��tttttft|t�r|��n|�}zC|D]=}t|ttf�r4t|t�r+|�	d�}|�
dd�\}}n|\}}t|t�rB|�	d�n|}t|t�rN|�	d�n|}||fVqWdSttfyn}ztd|���d�d}~ww)z:Convert environemnt dict or list to bytes-based dictionary�utf-8�=rzInvalid environment value: N)
rrr�
BytesOrStr�
isinstance�dict�itemsr=r<�encode�split�	TypeError�
ValueError)rN�item�	key_bytes�value_bytes�key�value�excr*r*r-�
encode_env�s2��

�������r_�patternsccs��|D]D}t|t�r|�d�}tjr(tj��D]\}}t�||�r&||fVqqtj��D]\}}|�d�}|�d�}t�||�rF||fVq-qdS)z3Look up environemnt variables with wildcard matchesrON)	rRr<rU�os�supports_bytes_environ�environbrT�fnmatch�environ)r`�patternrZr[r\r]r*r*r-�
lookup_env�s$�


��


���rgc	csD�|��D]\}}z
|�d�|�d�fVWqtyYqwdS)z7Convert bytes-based environemnt dict to Unicode stringsrON)rT�decode�UnicodeDecodeError)rNr\r]r*r*r-�
decode_env�s���rj�, r]�prefixcCst|�}|r
||SdS)z:Return a string with optional prefix if value is non-emptyrE�r<)r]rlr*r*r-�
hide_empty�srnrJ�length�label�suffixcCs"|�d|�|dkr
|��Sd��S)z-Return a label with an optional plural suffix� rrEr*)rorprqr*r*r-�plural�s"rs�seqcCstdd�|D��S)z*Return if a sequence contains all integerscss�|]}t|t�VqdS�N)rRr;��.0�ir*r*r-�	<genexpr>�s�zall_ints.<locals>.<genexpr>)�all)rtr*r*r-�all_ints�sr{�symbols�
strip_leadingcs��fdd�|��D�S)z8Return a mapping from values to symbol names for loggingcs(i|]\}}|���r||�d��qSru)�
startswith)rwr1r]�rlr}r*r-�
<dictcomp>�s�z$get_symbol_names.<locals>.<dictcomp>)rT)r|rlr}r*rr-�get_symbol_names�sr�))�@�_at_)�.�_dot_)�-�_r1cCstD]
\}}|�||�}q|S)z9Map punctuation so a string can be used as a handler name)�_HANDLER_PUNCTUATION�replace)r1�old�newr*r*r-�map_handler_name�sr��addrcCs�ztj|dtjtjtjd�d}Wntjy|YSw|dtjkr^|d}|d}|�d�}|dkr<|d|�}t�	|�}|j
r^ttt
tttf|�d}t
t�	t|�|d>B��}|S)z�Normalize scoped IP address

       The ipaddress module doesn't handle scoped addresses properly,
       so we normalize scoped IP addresses using socket.getaddrinfo
       before we pass them into ip_address/ip_network.

    N)�family�type�flagsr��%��`)�socket�getaddrinfo�	AF_UNSPEC�SOCK_STREAM�AI_NUMERICHOST�gaierror�AF_INET6�find�	ipaddress�
ip_address�
is_link_localrrr<r;)r��addrinfo�sa�idx�ip�scope_idr*r*r-�_normalize_scoped_ip�s*	���

r�cCst�t|��S)z@Wrapper for ipaddress.ip_address which supports scoped addresses)r�r�r�)r�r*r*r-r�
sr�cCsD|�d�}|dkr|d|�||d�}}nd}t�t|�|�S)z@Wrapper for ipaddress.ip_network which supports scoped addresses�/rNrE)r�r��
ip_networkr�)r�r��maskr*r*r-r�s

r�����filename�mode�	bufferingcCstt|���||d�S)z)Open a file with home directory expansion)r�)�openr�
expanduser)r�r�r�r*r*r-�	open_filesr�cCr)�z5Read from a binary file with home directory expansionNr*)r�r*r*r-�	read_file%r/r��rbcCr)r�r*�r�r�r*r*r-r�)r/�rcCr))z3Read from a text file with home directory expansionNr*r�r*r*r-r�-r/cCs6t||��}|��Wd�S1swYdS)z.Read from a file with home directory expansionN)r��read)r�r��fr*r*r-r�1s$��wb�datacCs8t||��
}|�|�Wd�S1swYdS)z7Write or append to a file with home directory expansionN)r��write)r�r�r�r�r*r*r-�
write_file8s$�r��file_objcCs&t�|���}t�|tjddd�dS)z/Enable sparse file support on a file on Windows�rN)�msvcrt�
get_osfhandle�fileno�	win32file�DeviceIoControl�winioctlcon�FSCTL_SET_SPARSE)r��handler*r*r-�make_sparse_file@s
�r��	_file_objcCr))z=Sparse files are automatically enabled on non-Windows systemsNr*)r�r*r*r-r�Hr/�suffixescsjt�|���dr��d�n���zt��fdd�tdt��d�D��WSty4td|�d�w)	z4Parse a series of integers followed by unit suffixesr�rEc3s0�|]}t�|���|d��VqdS)rN)�float�lowerrv��matchesr�r*r-ryWs�(�z_parse_units.<locals>.<genexpr>r��Invalid N)	�
_unit_patternrV�append�pop�sum�range�len�KeyErrorrX)r]r�rpr*r�r-�_parse_unitsLs

��r�cCstt|td��S)z4Parse a byte count with optional k, m, or g suffixesz
byte count)r;r��_byte_units�r]r*r*r-�parse_byte_count]sr�cCst|td�S)z=Parse a time interval with optional s, m, h, d, or w suffixesz
time interval)r��_time_unitsr�r*r*r-�parse_time_intervalcsr��commandcCs,tj|dd�}d|_tjdkrg|_t|�S)z/Split a command string into a list of argumentsT)�posixr&)�shlex�whitespace_split�sys�platform�escape�list)r��lexr*r*r-�
split_argsis

r��_ACM)�bound�	covariantc	@sveZdZdZdeefdd�Zdeedeffdd�Z	defd	d
�Z
deee
dee
d
eedeefdd�ZdS)�_ACMWrapperzAsync context manager wrapper�corocCs||_d|_dSru)�_coro�_coro_result)r,r�r*r*r-�__init__zs
z_ACMWrapper.__init__r(NcCs
|j��Sru)r��	__await__r+r*r*r-r�~s
z_ACMWrapper.__await__c�s �|jIdH|_|j��IdHSru)r�r��
__aenter__r+r*r*r-r��s�z_ACMWrapper.__aenter__�exc_type�	exc_value�	tracebackc�s0�|jdusJ�|j�|||�IdH}d|_|Sru)r��	__aexit__)r,r�r�r��exit_resultr*r*r-r��s�
�z_ACMWrapper.__aexit__)r6r7r8r9rr�r�rrr�r�rr�
BaseExceptionr�boolr�r*r*r*r-r�ws���r�.r�cs$t���dttf�fdd��}|S)a�Decorator for functions returning asynchronous context managers

       This decorator can be used on functions which return objects
       intended to be async context managers. The object returned by
       the function should implement __aenter__ and __aexit__ methods
       to run when the async context is entered and exited.

       This wrapper also allows the use of "await" on the function being
       decorated, to return the context manager without entering it.

    r(cst�|i|���S)z:Return an async context manager wrapper for this coroutine)r�)�args�kwargs�r�r*r-�context_wrapper�sz.async_context_manager.<locals>.context_wrapper)�	functools�wrapsr�r�)r�r�r*r�r-�async_context_manager�s
r��writerc�s,�z
|��IdHWdStyYdSw)a�Wait for a StreamWriter to close, if Python version supports it

       Python 3.8 triggers a false error report about garbage collecting
       an open stream if a close is in progress when a StreamWriter is
       garbage collected. This can be avoided by calling wait_closed(),
       but that method is not available in Python releases prior to 3.7.
       This function wraps this call, ignoring the error if the method
       is not available.

    N)rB�AttributeError)r�r*r*r-�maybe_wait_closed�s��r��funcr�c�s$�t��}|jd|g|�R�IdHS)z%Run a function in an asyncio executorN)�asyncio�get_event_loop�run_in_executor)rr��loopr*r*r-r�s�r�tty�width�height�pixwidth�	pixheightcCs"t�|tjt�d||||��dS)zSet the terminal size of a TTY�hhhhN)�fcntl�ioctl�termios�
TIOCSWINSZ�struct�pack)rrrrr	r*r*r-�set_terminal_size�s
�rc@s^eZdZUdZeeefed<ddeddefdd�Z	deddfdd	�Z
deddfd
d�ZdS)
�Optionsz#Container for configuration optionsr�N�optionscKsh|r t|t|��stdt|�j�dt|�j����|j��|_ni|_|j�|�|jdi|j��dS)Nr�z, got r*)rRr�rWr6r��copyr5�prepare)r,rr�r*r*r-r��s�zOptions.__init__r(cKr))z!Pre-process configuration optionsNr*�r,r�r*r*r-r�r/zOptions.preparecKs"|j�|�|jdi|j��dS)z4Update options based on keyword parameters passed inNr*)r�r5rrr*r*r-r5�szOptions.updateru)r6r7r8r9r
r<�object�__annotations__rr�rr5r*r*r*r-r�s

rc
s`eZdZUdZiZeeefed<de	ddede
edfdeeefddf
�fd	d
�Z�Z
S)�_RecordMetaz)Metaclass for general-purpose record type�	__slots__�mcsr1�bases.�nsr(csTttt��|||���}|dkr(ttttf|j���}�fdd�|D�}||_|S)N�Recordcsi|]}|��|��qSr*)�get�rwrF�rr*r-r��sz'_RecordMeta.__new__.<locals>.<dictcomp>)	rr�super�__new__rr<r�keysr)rr1rr�cls�fields�defaults��	__class__r!r-r#�sz_RecordMeta.__new__)r6r7r8r9rr
r<rrrrr�r#�
__classcell__r*r*r(r-r�s

��rc@sneZdZUdZiZeeefed<dedefdd�Z	defdd	�Z
defd
d�Zded
edeefdd�Z
dS)rzGeneric Record classrr�r�cOsd|j��D]
\}}t|||�qt|j|�D]
\}}t|||�q|��D]
\}}t|||�q%dSru)rrT�setattr�zip)r,r�r�rF�vr*r*r-r�s�zRecord.__init__r(cs0d��fdd��jD��}t��j�d|�d�S)Nrkc3s$�|]
}|�dt�|���VqdS)�=N)�getattrr r+r*r-rys�"z"Record.__repr__.<locals>.<genexpr>�(�))�joinrr�r6�r,�valuesr*r+r-�__repr__
szRecord.__repr__cs(�fdd��jD�}d�dd�|D��S)Nc3s&�|]}|��|t�|��fVqdSru)�_formatr/r r+r*r-rys��z!Record.__str__.<locals>.<genexpr>rkcss*�|]\}}|dur|�d|��VqdS)Nz: r*)rwrFr-r*r*r-rys�()rr2r3r*r+r-�__str__s
�zRecord.__str__rFr-cCst|�S)zFormat a field as a stringrm)r,rFr-r*r*r-r6szRecord._formatN)r6r7r8r9rrr<rrr�r5r7rr6r*r*r*r-r�s

r)�	metaclasscs2eZdZdZefdededef�fdd�
Z�ZS)�ErrorzGeneral SSH error�code�reason�langcs"t��|�||_||_||_dSru)r"r�r:r;r<)r,r:r;r<r(r*r-r�s
zError.__init__)	r6r7r8r9rr;r<r�r*r*r*r(r-r9s&r9c@�eZdZdZdS)�DisconnectErrora�SSH disconnect error

       This exception is raised when a serious error occurs which causes
       the SSH connection to be disconnected. Exception codes should be
       taken from :ref:`disconnect reason codes <DisconnectReasons>`.
       See below for exception subclasses tied to specific disconnect
       reasons if you want to customize your handling by reason.

       :param code:
           Disconnect reason, taken from :ref:`disconnect reason
           codes <DisconnectReasons>`
       :param reason:
           A human-readable reason for the disconnect
       :param lang: (optional)
           The language the reason is in
       :type code: `int`
       :type reason: `str`
       :type lang: `str`

    N�r6r7r8r9r*r*r*r-r>&�r>c�.eZdZdZefdedef�fdd�
Z�ZS)�CompressionErrora^SSH compression error

       This exception is raised when an error occurs while compressing
       or decompressing data sent on the SSH connection.

       :param reason:
           Details about the compression error
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<c�t��t||�dSru)r"r�r�r,r;r<r(r*r-r�L�zCompressionError.__init__�r6r7r8r9rr<r�r*r*r*r(r-rB=�"rBcrA)�ConnectionLosta�SSH connection lost

       This exception is raised when the SSH connection to the remote
       system is unexpectedly lost. It can also occur as a result of
       the remote system failing to respond to keepalive messages or
       as a result of a login timeout, when those features are enabled.

       :param reason:
           Details about the connection failure
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru)r"r�rrDr(r*r-r�arEzConnectionLost.__init__rFr*r*r(r-rHP�"rHcrA)�HostKeyNotVerifiableaXSSH host key not verifiable

       This exception is raised when the SSH server's host key or
       certificate is not verifiable.

       :param reason:
           Details about the host key verification failure
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru)r"r�rrDr(r*r-r�trEzHostKeyNotVerifiable.__init__rFr*r*r(r-rJerGrJcrA)�IllegalUserNameaVSSH illegal user name

       This exception is raised when an error occurs while processing
       the username sent during the SSL handshake.

       :param reason:
           Details about the illegal username
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru)r"r�rrDr(r*r-r��rEzIllegalUserName.__init__rFr*r*r(r-rKxrGrKcrA)�KeyExchangeFaileda"SSH key exchange failed

       This exception is raised when the SSH key exchange fails.

       :param reason:
           Details about the connection failure
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru)r"r�r rDr(r*r-r��rEzKeyExchangeFailed.__init__rFr*r*r(r-rL�s"
rLcrA)�MACErroralSSH MAC error

       This exception is raised when an error occurs while processing
       the message authentication code (MAC) of a message on the SSH
       connection.

       :param reason:
           Details about the MAC error
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru)r"r�r!rDr(r*r-r��rEzMACError.__init__rFr*r*r(r-rM�s"rMcrA)�PermissionDeniedaiSSH permission denied

       This exception is raised when there are no authentication methods
       remaining to complete SSH client authentication.

       :param reason:
           Details about the SSH protocol error detected
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru)r"r�r"rDr(r*r-r��rEzPermissionDenied.__init__rFr*r*r(r-rN�rGrNcrA)�
ProtocolErroraaSSH protocol error

       This exception is raised when the SSH connection is disconnected
       due to an SSH protocol error being detected.

       :param reason:
           Details about the SSH protocol error detected
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru�r"r�r#rDr(r*r-r��rEzProtocolError.__init__rFr*r*r(r-rO�rGrOcrA)�ProtocolNotSupportedafSSH protocol not supported

       This exception is raised when the remote system sends an SSH
       protocol version which is not supported.

       :param reason:
           Details about the unsupported SSH protocol version
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCrurPrDr(r*r-r��rEzProtocolNotSupported.__init__rFr*r*r(r-rQ�rGrQcrA)�ServiceNotAvailableaTSSH service not available

       This exception is raised when an unexpected service name is
       received during the SSH handshake.

       :param reason:
           Details about the unexpected SSH service
       :param lang: (optional)
           The language the reason is in
       :type reason: `str`
       :type lang: `str`

    r;r<crCru)r"r�r%rDr(r*r-r��rEzServiceNotAvailable.__init__rFr*r*r(r-rR�rGrRc@r=)�ChannelOpenErrora�SSH channel open error

       This exception is raised by connection handlers to report
       channel open failures.

       :param code:
           Channel open failure reason, taken from :ref:`channel open
           failure reason codes <ChannelOpenFailureReasons>`
       :param reason:
           A human-readable reason for the channel open failure
       :param lang:
           The language the reason is in
       :type code: `int`
       :type reason: `str`
       :type lang: `str`

    Nr?r*r*r*r-rS�r@rSc@r=)�ChannelListenErrorz�SSH channel listen error

       This exception is raised to report failures in setting up
       remote SSH connection listeners.

       :param details:
           Details of the listen failure
       :type details: `str`

    Nr?r*r*r*r-rTr@rTcrA)�PasswordChangeRequireda�SSH password change required

       This exception is raised during password validation on the
       server to indicate that a password change is required. It
       should be raised when the password provided is valid but
       expired, to trigger the client to provide a new password.

       :param prompt:
           The prompt requesting that the user enter a new password
       :param lang:
           The language that the prompt is in
       :type prompt: `str`
       :type lang: `str`

    �promptr<cs"t��d|���||_||_dS)NzPassword change required: )r"r�rVr<)r,rVr<r(r*r-r�/s
zPasswordChangeRequired.__init__rFr*r*r(r-rUrIrUc�&eZdZdZdef�fdd�Z�ZS)�
BreakReceivedz�SSH break request received

       This exception is raised on an SSH server stdin stream when the
       client sends a break on the channel.

       :param msec:
           The duration of the break in milliseconds
       :type msec: `int`

    �mseccst��d|�d��||_dS)Nz
Break for z msec)r"r�rY)r,rYr(r*r-r�As
zBreakReceived.__init__)r6r7r8r9r;r�r*r*r*r(r-rX5�rXcrW)�SignalReceivedz�SSH signal request received

       This exception is raised on an SSH server stdin stream when the
       client sends a signal on the channel.

       :param signal:
           The name of the signal sent by the client
       :type signal: `str`

    �signalcst��d|���||_dS)NzSignal: )r"r�r\)r,r\r(r*r-r�Rs
zSignalReceived.__init__)r6r7r8r9r<r�r*r*r*r(r-r[FrZr[cs"eZdZdZd�fdd�Z�ZS)�SoftEOFReceivedz�SSH soft EOF request received

       This exception is raised on an SSH server stdin stream when the
       client sends an EOF from within the line editor on the channel.

    r(Ncst��d�dS)NzSoft EOF)r"r�r+r(r*r-r�_szSoftEOFReceived.__init__rC)r6r7r8r9r�r*r*r*r(r-r]Wsr]csDeZdZdZdedededef�fdd�Zedefd	d
��Z�Z	S)�TerminalSizeChangeda"SSH terminal size change notification received

       This exception is raised on an SSH server stdin stream when the
       client sends a terminal size change on the channel.

       :param width:
           The new terminal width
       :param height:
           The new terminal height
       :param pixwidth:
           The new terminal width in pixels
       :param pixheight:
           The new terminal height in pixels
       :type width: `int`
       :type height: `int`
       :type pixwidth: `int`
       :type pixheight: `int`

    rrrr	csBt��d|�d|�d|�d|�d�	�||_||_||_||_dS)NzTerminal size change: (rkr1)r"r�rrrr	)r,rrrr	r(r*r-r�xs�
�
zTerminalSizeChanged.__init__r(cCs|j|j|j|jfS)z-Return terminal size as a tuple of 4 integers)rrrr	r+r*r*r-�	term_size�szTerminalSizeChanged.term_size)
r6r7r8r9r;r�r:�TermSizer_r*r*r*r(r-r^cs
r^r:r;r<c	Cs<zt|||�WStyt||�d|�d�|�YSw)zBMap disconnect error code to appropriate DisconnectError exceptionz (error r1)�_disc_error_mapr�r>)r:r;r<r*r*r-�construct_disc_error�s
�rb)rk)rJ)r)r�)r�)r�)r�rAr(N)�r9rrdr�r�ra�rer�r�r��pathlibrr�randomr�typesr�typingrrrr	r
rrr
rrrrrrrrrr�typing_extensionsrr�	constantsrrrrrr r!r"r#r$r%�_pywin32_availabler�r�r�r��ImportErrorrrr
r;�	TermModes�TermModesArgr`�TermSizeArgr'r>rArD�DefTuple�
MaybeAwaitr��ExcInfo�
OptExcInfor=r<rQ�BytesOrStrDict�FilePath�HostPort�IPv4Address�IPv6Address�	IPAddress�IPv4Network�IPv6Network�	IPNetwork�SockAddr�EnvMap�EnvItems�EnvSeq�Env�_random�	randrange�compiler�r�r�r_rgrjrrnrsr�r{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��_ACMCoro�_ACMWrapperFuncr�r�rrrr�rr�	Exceptionr9r>rBrHrJrKrLrMrNrOrQrRrSrTrUrXr[r]r^rarbr*r*r*r-�<module>s* $
�
 
�&
��

�		! 
"
��
�!

%�