
    )JfKV                       d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
ZddlZddlZddlZddlmZ ddlmZ ddlZddlmZ ddlmZ ddlmZmZmZmZmZ dZ ej        e          Z  G d de!          Z" G d de"          Z# G d	 d
e"          Z$ G d de!          Z% G d dej&        j'                  Z(dS )zCore connection objects    N)xrangeurl_unquotedictkeysdict_itervaluesdict_iteritemszPika Python Client Libraryc                   .   e Zd ZdZdZdZdZdZej	        j
        ZdZej                            ee          ZdZej        ZdZdZdZdZd	Zd
ZdZdZdZdZdZdZd Z d Z!d Z"d Z#e$d             Z%e%j&        d             Z%e$d             Z'e'j&        d             Z'e$d             Z(e(j&        d             Z(e$d             Z)e)j&        d             Z)e$d             Zej&        d             Ze$d             Z*e*j&        d             Z*e$d             Z+e+j&        d              Z+e$d!             Z,e,j&        d"             Z,e$d#             Z-e-j&        d$             Z-e$d%             Z.e.j&        d&             Z.e$d'             Z/e/j&        d(             Z/e$d)             Z0e0j&        d*             Z0e$d+             Z1e1j&        d,             Z1e$d-             Z2e2j&        d.             Z2e$d/             Z3e3j&        d0             Z3e$d1             Z4e4j&        d2             Z4dS )3
Parametersz1Base connection parameters class definition

    )_blocked_connection_timeout_channel_max_client_properties_connection_attempts_credentials
_frame_max
_heartbeat_host_locale_port_retry_delay_socket_timeout_stack_timeout_ssl_options_virtual_host_tcp_optionsguestN   	localhosten_USi(  g       @g      $@g      .@Fi'  /c                 f   d | _         | j        | _        d | _        | j        | _        d | _        | j        | _        d | _	        | j
        | _        d | _        | j        | _        d | _        | j        | _        d | _        | j        | _        d | _        | j        | _        d | _        | j        | _        d | _        | j        | _        d | _        | j        | _         d | _!        | j"        | _#        d | _$        | j%        | _&        d | _'        | j(        | _)        d | _*        | j+        | _,        d | _-        | j.        | _/        d S N)0r
   "DEFAULT_BLOCKED_CONNECTION_TIMEOUTblocked_connection_timeoutr   DEFAULT_CHANNEL_MAXchannel_maxr   DEFAULT_CLIENT_PROPERTIESclient_propertiesr   DEFAULT_CONNECTION_ATTEMPTSconnection_attemptsr   DEFAULT_CREDENTIALScredentialsr   DEFAULT_FRAME_MAX	frame_maxr   DEFAULT_HEARTBEAT_TIMEOUT	heartbeatr   DEFAULT_HOSThostr   DEFAULT_LOCALElocaler   DEFAULT_PORTportr   DEFAULT_RETRY_DELAYretry_delayr   DEFAULT_SOCKET_TIMEOUTsocket_timeoutr   DEFAULT_STACK_TIMEOUTstack_timeoutr   DEFAULT_SSL_OPTIONSssl_optionsr   DEFAULT_VIRTUAL_HOSTvirtual_hostr   DEFAULT_TCP_OPTIONStcp_optionsselfs    R/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/pika/connection.py__init__zParameters.__init__H   s5   
 ,0(3 	' !3"&!%!?$(!#'#C  3/7
%	)
%	 3#"9"!7 3! 5 3    c                 |    d| j         j        d| j        d| j        d| j        dt          | j                  dS )zERepresent the info about the instance.

        :rtype: str

        <z host=z port=z virtual_host=z ssl=>)	__class____name__r0   r4   r>   boolr<   rA   s    rC   __repr__zParameters.__repr__~   sM      ((($)))TYYY"""D)9$:$:$:$:< 	=rE   c                 z    t          |t                    r | j        |j        k    o| j        |j        k    S t          S r    )
isinstancer	   r   r   NotImplemented)rB   others     rC   __eq__zParameters.__eq__   s8    eZ(( 	K:,Ju{1JJrE   c                 R    |                      |          }|t          ur| S t          S r    )rQ   rO   )rB   rP   results      rC   __ne__zParameters.__ne__   s,    U##'':rE   c                     | j         S )z
        :returns: blocked connection timeout. Defaults to
            `DEFAULT_BLOCKED_CONNECTION_TIMEOUT`.
        :rtype: float|None

        )r
   rA   s    rC   r"   z%Parameters.blocked_connection_timeout   s     //rE   c                     |Dt          |t          j                  st          d|          |dk     rt	          d|          || _        dS )a  
        :param value: If not None, blocked_connection_timeout is the timeout, in
            seconds, for the connection to remain blocked; if the timeout
            expires, the connection will be torn down, triggering the
            connection's on_close_callback

        Nz:blocked_connection_timeout must be a Real number, but got r   z1blocked_connection_timeout must be >= 0, but got )rN   numbersReal	TypeError
ValueErrorr
   rB   values     rC   r"   z%Parameters.blocked_connection_timeout   sv     eW\22 Ai8=!@ A A Aqyy j-2U"5 6 6 6+0(((rE   c                     | j         S )z
        :returns: max preferred number of channels. Defaults to
            `DEFAULT_CHANNEL_MAX`.
        :rtype: int

        )r   rA   s    rC   r$   zParameters.channel_max          rE   c                     t          |t          j                  st          d|          |dk     s|t          j        j        k    r#t          dt          j        j        |fz            || _        dS )z
        :param int value: max preferred number of channels, between 1 and
           `channel.MAX_CHANNELS`, inclusive

        z$channel_max must be an int, but got r   z-channel_max must be <= %i and > 0, but got %rN)	rN   rW   IntegralrY   pikachannelMAX_CHANNELSrZ   r   r[   s     rC   r$   zParameters.channel_max   s     %!122 	Q)OPPP199 999L"l7?@ A A A!rE   c                     | j         S )z
        :returns: client properties used to override the fields in the default
            client properties reported  to RabbitMQ via `Connection.StartOk`
            method. Defaults to `DEFAULT_CLIENT_PROPERTIES`.
        :rtype: dict|None

        )r   rA   s    rC   r&   zParameters.client_properties   s     &&rE   c                     t          |t          t          d          f          st          d|          t	          j        |          | _        dS )z
        :param value: None or dict of client properties used to override the
            fields in the default client properties reported to RabbitMQ via
            `Connection.StartOk` method.
        Nz0client_properties must be dict or None, but got )rN   dicttyperY   copydeepcopyr   r[   s     rC   r&   zParameters.client_properties   sc     %T

"
   	5 ),1E4 5 5 5 #'-"6"6rE   c                     | j         S )z
        :returns: number of socket connection attempts. Defaults to
            `DEFAULT_CONNECTION_ATTEMPTS`. See also `retry_delay`.
        :rtype: int

        )r   rA   s    rC   r(   zParameters.connection_attempts   s     ((rE   c                     t          |t          j                  st          d          |dk     rt	          d|          || _        dS )z|
        :param int value: number of socket connection attempts of at least 1.
            See also `retry_delay`.

        z"connection_attempts must be an intr   z)connection_attempts must be > 0, but got N)rN   rW   r`   rY   rZ   r   r[   s     rC   r(   zParameters.connection_attempts   s_     %!122 	B@AAA199*AFHJ J J$)!!!rE   c                     | j         S )z
        :rtype: one of the classes from `pika.credentials.VALID_TYPES`. Defaults
            to `DEFAULT_CREDENTIALS`.

        )r   rA   s    rC   r*   zParameters.credentials   s       rE   c                     t          |t          t          j        j                            s$t          dt          j        j        d|          t          j        |          | _        dS )z
        :param value: authentication credential object of one of the classes
            from  `pika.credentials.VALID_TYPES`

        z'credentials must be an object of type: z
, but got N)	rN   tuplera   r*   VALID_TYPESrY   rh   ri   r   r[   s     rC   r*   zParameters.credentials  so     %t'7'C!D!DEE 	N)(,(8(D(D(DeeM N N N !M%00rE   c                     | j         S )z
        :returns: desired maximum AMQP frame size to use. Defaults to
            `DEFAULT_FRAME_MAX`.
        :rtype: int

        )r   rA   s    rC   r,   zParameters.frame_max  s     rE   c                 $   t          |t          j                  st          d|          |t          j        k     rt          dt          j        |fz            |t          j        k    rt          dt          j        |fz            || _        dS )z
        :param int value: desired maximum AMQP frame size to use between
            `spec.FRAME_MIN_SIZE` and `spec.FRAME_MAX_SIZE`, inclusive

        z"frame_max must be an int, but got z+Min AMQP 0.9.1 Frame Size is %i, but got %rz+Max AMQP 0.9.1 Frame Size is %i, but got %rN)	rN   rW   r`   rY   specFRAME_MIN_SIZErZ   FRAME_MAX_SIZEr   r[   s     rC   r,   zParameters.frame_max  s     %!122 	O)eeMNNN4&&&J#N     T(((J#N      rE   c                     | j         S )aI  
        :returns: AMQP connection heartbeat timeout value for negotiation during
            connection tuning or callable which is invoked during connection tuning.
            None to accept broker's value. 0 turns heartbeat off. Defaults to
            `DEFAULT_HEARTBEAT_TIMEOUT`.
        :rtype: int|callable|None

        )r   rA   s    rC   r.   zParameters.heartbeat/  s     rE   c                     |bt          |t          j                  s!t          |          st	          d|          t          |          s|dk     rt          d|          || _        dS )a<  
        :param int|None|callable value: Controls AMQP heartbeat timeout negotiation
            during connection tuning. An integer value always overrides the value
            proposed by broker. Use 0 to deactivate heartbeats and None to always
            accept the broker's proposal. If a callable is given, it will be called
            with the connection instance and the heartbeat timeout proposed by broker
            as its arguments. The callback should return a non-negative integer that
            will be used to override the broker's proposal.
        Nz9heartbeat must be an int or a callable function, but got r   zheartbeat must >= 0, but got )rN   rW   r`   callablerY   rZ   r   r[   s     rC   r.   zParameters.heartbeat;  s     eW%566  x  iu      E?? Ouqyy jee!MNNNrE   c                     | j         S )zn
        :returns: hostname or ip address of broker. Defaults to `DEFAULT_HOST`.
        :rtype: str

        )r   rA   s    rC   r0   zParameters.hostO  s     zrE   c                 >    t          j        |d           || _        dS )zE
        :param str value: hostname or ip address of broker

        r0   N)
validatorsrequire_stringr   r[   s     rC   r0   zParameters.hostX  s"     	!%000


rE   c                     | j         S )z
        :returns: locale value to pass to broker; e.g., 'en_US'. Defaults to
            `DEFAULT_LOCALE`.
        :rtype: str

        )r   rA   s    rC   r2   zParameters.localea  s     |rE   c                 >    t          j        |d           || _        dS )zR
        :param str value: locale value to pass to broker; e.g., "en_US"

        r2   N)rz   r{   r   r[   s     rC   r2   zParameters.localek  s"     	!%222rE   c                     | j         S )z
        :returns: port number of broker's listening socket. Defaults to
            `DEFAULT_PORT`.
        :rtype: int

        )r   rA   s    rC   r4   zParameters.portt  s     zrE   c                 ~    	 t          |          | _        dS # t          t          f$ r t          d|          w xY w)zM
        :param int value: port number of broker's listening socket

        zport must be an int, but got N)intr   rY   rZ   r[   s     rC   r4   zParameters.port~  sR    	JUDJJJ:& 	J 	J 	J)HIII	Js    $<c                     | j         S )z
        :returns: interval between socket connection attempts; see also
            `connection_attempts`. Defaults to `DEFAULT_RETRY_DELAY`.
        :rtype: float

        )r   rA   s    rC   r6   zParameters.retry_delay  r^   rE   c                 l    t          |t          j                  st          d|          || _        dS )z
        :param int | float value: interval between socket connection attempts;
            see also `connection_attempts`.

        z,retry_delay must be a float or int, but got N)rN   rW   rX   rY   r   r[   s     rC   r6   zParameters.retry_delay  sF     %.. 	M)DIEKM M M!rE   c                     | j         S )z
        :returns: socket connect timeout in seconds. Defaults to
            `DEFAULT_SOCKET_TIMEOUT`. The value None disables this timeout.
        :rtype: float|None

        )r   rA   s    rC   r8   zParameters.socket_timeout  s     ##rE   c                     |St          |t          j                  st          d|          |dk    rt	          d|          t          |          }|| _        dS )z
        :param int | float | None value: positive socket connect timeout in
            seconds. None to disable this timeout.

        Nz/socket_timeout must be a float or int, but got r   z$socket_timeout must be > 0, but got )rN   rW   rX   rY   rZ   floatr   r[   s     rC   r8   zParameters.socket_timeout  s}     eW\22 9i05!8 9 9 9zz j@EGI I I%LLE$rE   c                     | j         S )z
        :returns: full protocol stack TCP/[SSL]/AMQP bring-up timeout in
            seconds. Defaults to `DEFAULT_STACK_TIMEOUT`. The value None
            disables this timeout.
        :rtype: float

        )r   rA   s    rC   r:   zParameters.stack_timeout  s     ""rE   c                     |St          |t          j                  st          d|          |dk    rt	          d|          t          |          }|| _        dS )z
        :param int | float | None value: positive full protocol stack
            TCP/[SSL]/AMQP bring-up timeout in seconds. It's recommended to set
            this value higher than `socket_timeout`. None to disable this
            timeout.

        Nz.stack_timeout must be a float or int, but got r   z#stack_timeout must be > 0, but got )rN   rW   rX   rY   rZ   r   r   r[   s     rC   r:   zParameters.stack_timeout  s}     eW\22 9i05!8 9 9 9zz j?DuFH H H%LLE#rE   c                     | j         S )z
        :returns: None for plaintext or `pika.SSLOptions` instance for SSL/TLS.
        :rtype: `pika.SSLOptions`|None
        )r   rA   s    rC   r<   zParameters.ssl_options         rE   c                     t          |t          t          d          f          st          d|          || _        dS )z
        :param `pika.SSLOptions`|None value: None for plaintext or
            `pika.SSLOptions` instance for SSL/TLS. Defaults to None.

        Nz/ssl_options must be None or SSLOptions but got )rN   
SSLOptionsrg   rY   r   r[   s     rC   r<   zParameters.ssl_options  sO     %*d4jj!9:: 	P)GLuNP P P!rE   c                     | j         S )z|
        :returns: rabbitmq virtual host name. Defaults to
            `DEFAULT_VIRTUAL_HOST`.
        :rtype: str

        )r   rA   s    rC   r>   zParameters.virtual_host  s     !!rE   c                 >    t          j        |d           || _        dS )z?
        :param str value: rabbitmq virtual host name

        r>   N)rz   r{   r   r[   s     rC   r>   zParameters.virtual_host  s%     	!%888"rE   c                     | j         S )zp
        :returns: None or a dict of options to pass to the underlying socket
        :rtype: dict|None
        )r   rA   s    rC   r@   zParameters.tcp_options  r   rE   c                     t          |t          t          d          f          st          d|          || _        dS )a  
        :param dict|None value: None or a dict of options to pass to the underlying
            socket. Currently supported are TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT
            and TCP_USER_TIMEOUT. Availability of these may depend on your platform.
        Nz,tcp_options must be a dict or None, but got )rN   rf   rg   rY   r   r[   s     rC   r@   zParameters.tcp_options	  sO     %$T

!344 	M)DIEKM M M!rE   )5rJ   
__module____qualname____doc__	__slots__DEFAULT_USERNAMEDEFAULT_PASSWORDr!   ra   rb   rc   r#   r%   r*   PlainCredentialsr)   r'   rr   rt   r+   r-   r/   r1   r3   r5   r7   r9   DEFAULT_SSLr;   DEFAULT_SSL_PORTr=   r?   rD   rL   rQ   rT   propertyr"   setterr$   r&   r(   r,   r.   r0   r2   r4   r6   r8   r:   r<   r>   r@    rE   rC   r	   r	   $   s        BI )-&,3 $*;;*, ,"#+ $LNL! K44 44 44l= = =  
   0 0 X0  &1 1 '&1" ! ! X! " " " ' ' X' 7 7 7 ) ) X) * *  * ! ! X! 
1 
1 
1   X      ( 	 	 X	      &   X 
[  [   X ]  ]   X 
[J J [J ! ! X! 	" 	" 	" $ $ X$ % % %" # # X# $ $ $& ! ! X! 	" 	" 	" " " X" # # # ! ! X! 	" 	" 	" 	" 	"rE   r	   c                   d     e Zd ZdZdZ G d de          Zeeeeeeeeeeeeeeeef fd	Z xZS )ConnectionParametersz^Connection parameters object that is passed into the connection adapter
    upon construction.r   c                       e Zd ZdZdS )ConnectionParameters._DEFAULTz0Designates default parameter value; internal useN)rJ   r   r   r   r   rE   rC   _DEFAULTr     s        >>>>rE   r   c                    t          t          |                                            || j        ur|| _        || j        ur|| _        || j        ur|| _        |	| j        ur|	| _        || j        ur|| _        || j        ur|| _	        || j        ur|| _
        || j        ur|| _        || j        ur|| _        |
| j        ur|
| _        || j        ur|| _        || j        ur|| _        || j        ur|| _        || j        ur|| _        n| j        r| j        n| j        | _        || j        ur|| _        || j        ur|| _        |rt-          d|          dS )a
  Create a new ConnectionParameters instance. See `Parameters` for
        default values.

        :param str host: Hostname or IP Address to connect to
        :param int port: TCP port to connect to
        :param str virtual_host: RabbitMQ virtual host to use
        :param pika.credentials.Credentials credentials: auth credentials
        :param int channel_max: Maximum number of channels to allow
        :param int frame_max: The maximum byte size for an AMQP frame
        :param int|None|callable heartbeat: Controls AMQP heartbeat timeout negotiation
            during connection tuning. An integer value always overrides the value
            proposed by broker. Use 0 to deactivate heartbeats and None to always
            accept the broker's proposal. If a callable is given, it will be called
            with the connection instance and the heartbeat timeout proposed by broker
            as its arguments. The callback should return a non-negative integer that
            will be used to override the broker's proposal.
        :param `pika.SSLOptions`|None ssl_options: None for plaintext or
            `pika.SSLOptions` instance for SSL/TLS. Defaults to None.
        :param int connection_attempts: Maximum number of retry attempts
        :param int|float retry_delay: Time to wait in seconds, before the next
        :param int|float socket_timeout: Positive socket connect timeout in
            seconds.
        :param int|float stack_timeout: Positive full protocol stack
            (TCP/[SSL]/AMQP) bring-up timeout in seconds. It's recommended to
            set this value higher than `socket_timeout`.
        :param str locale: Set the locale value
        :param int|float|None blocked_connection_timeout: If not None,
            the value is a non-negative timeout, in seconds, for the
            connection to remain blocked (triggered by Connection.Blocked from
            broker); if the timeout expires before connection becomes unblocked,
            the connection will be torn down, triggering the adapter-specific
            mechanism for informing client app about the closed connection:
            passing `ConnectionBlockedTimeout` exception to on_close_callback
            in asynchronous adapters or raising it in `BlockingConnection`.
        :param client_properties: None or dict of client properties used to
            override the fields in the default client properties reported to
            RabbitMQ via `Connection.StartOk` method.
        :param tcp_options: None or a dict of TCP options to set for socket
        zunexpected kwargs: N)superr   rD   r   r"   r$   r&   r(   r*   r,   r.   r0   r2   r6   r8   r:   r<   r4   r   r3   r>   r@   rY   )rB   r0   r4   r>   r*   r$   r,   r.   r<   r(   r6   r8   r:   r2   r"   r&   r@   kwargsrI   s                     rC   rD   zConnectionParameters.__init__   s   t 	"D))22444%T]::.HD+dm++*DDM11%6D"dm33':D$dm++*DDM))&DNDM))&DNt}$$DI&& DKdm++*D.."0D--!.Ddm++*D t}$$DII151AX--tGXDIt},, ,Ddm++*D 	A)vv?@@@	A 	ArE   )	rJ   r   r   r   r   objectr   rD   __classcell__rI   s   @rC   r   r     s          I? ? ? ? ?6 ? ? ?
 !    ( #"'/& #pA pA pA pA pA pA pA pA pA pArE   r   c                   r     e Zd ZdZdZdZ fdZd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Z xZS )URLParametersa  Connect to RabbitMQ via an AMQP URL in the format::

         amqp://username:password@host:port/<virtual_host>[?query-string]

    Ensure that the virtual host is URI encoded when specified. For example if
    you are using the default "/" virtual host, the value should be `%2f`.

    See `Parameters` for default values.

    Valid query string values are:

        - channel_max:
            Override the default maximum channel count value
        - client_properties:
            dict of client properties used to override the fields in the default
            client properties reported to RabbitMQ via `Connection.StartOk`
            method
        - connection_attempts:
            Specify how many times pika should try and reconnect before it gives up
        - frame_max:
            Override the default maximum frame size for communication
        - heartbeat:
            Desired connection heartbeat timeout for negotiation. If not present
            the broker's value is accepted. 0 turns heartbeat off.
        - locale:
            Override the default `en_US` locale value
        - ssl_options:
            None for plaintext; for SSL: dict of public ssl context-related
            arguments that may be passed to :meth:`ssl.SSLSocket` as kwargs,
            except `sock`, `server_side`,`do_handshake_on_connect`, `family`,
            `type`, `proto`, `fileno`.
        - retry_delay:
            The number of seconds to sleep before attempting to connect on
            connection failure.
        - socket_timeout:
            Socket connect timeout value in seconds (float or int)
        - stack_timeout:
            Positive full protocol stack (TCP/[SSL]/AMQP) bring-up timeout in
            seconds. It's recommended to set this value higher than
            `socket_timeout`.
        - blocked_connection_timeout:
            Set the timeout, in seconds, that the connection may remain blocked
            (triggered by Connection.Blocked from broker); if the timeout
            expires before connection becomes unblocked, the connection will be
            torn down, triggering the connection's on_close_callback
        - tcp_options:
            Set the tcp options for the underlying socket.

    :param str url: The AMQP URL to connect to

    )_all_url_query_values	_set_url_c           	          t          t          |                                            d| _        |dd                                         dk    rd|dd         z   }t
          j                            |          }|j        dk    r,t          j	        t          j                              | _        n2|j        dk    rd| _        n|j        rt          d|j        d	          |j        |j        | _        |j        |j        | _        n| j        r| j        n| j        | _        |j        It
          j                            t-          |j                  t-          |j                            | _        t1          |j                  d
k    r2t-          |j                            d          d
                   | _        t
          j                            |j                  | _        t=          | j                  D ]\  }}	 t?          | | j         |z             }n # tB          $ r t          d|          w xY w	 |\  }n0# t          $ r# t          d|t1          |          |fz            w xY w ||           dS )zUCreate a new URLParameters instance.

        :param str url: The URL value

        Nr      amqphttphttps)contextzUnexpected URL scheme z&; supported scheme values: amqp, amqpsr   r   zUnknown URL parameter: zFExpected exactly one value for URL parameter %s, but got %i values: %s)"r   r   rD   r   lowerra   compaturlparseschemer   sslcreate_default_contextr<   rZ   hostnamer0   r4   r   r3   usernamer*   r   r   passwordlenpathsplitr>   url_parse_qsqueryr   getattr_SETTER_PREFIXAttributeError)rB   urlpartsnamer\   	set_valuerI   s         rC   rD   zURLParameters.__init__  s    	mT""++---%)" qs8>>v%%3qrr7"C$$S))<7""  $244 6  6  6D\V###D\ 	F*6;lllE F F F >%DI :!
DII !,D..262C I >%#/@@EN++[-H-H J  JD uz??Q +EJ,<,<S,A,A!,D E ED &*[%=%=ek%J%J")$*DEE 	 	KD%H#D$*=*DEE		! H H H j!FGGGHM  M M M 037UU2KLM M MM
 Ie	 	s   HH9=I-I/c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )8Deserialize and apply the corresponding query string argz)Invalid blocked_connection_timeout value : N)r   rZ   r"   )rB   r\   r"   excs       rC   #_set_url_blocked_connection_timeoutz1URLParameters._set_url_blocked_connection_timeout  sk    	).u&& 	 	 	*EEC  	 +E'''    
616c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )r   zInvalid channel_max value r   N)r   rZ   r$   )rB   r\   r$   r   s       rC   _set_url_channel_maxz"URLParameters._set_url_channel_max  sh    	e**KK 	 	 	*   	
 'r   c                 8    t          j        |          | _        dS r   N)astliteral_evalr&   r[   s     rC   _set_url_client_propertiesz(URLParameters._set_url_client_properties*  s    !$!1%!8!8rE   c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )r   z"Invalid connection_attempts value r   N)r   rZ   r(   )rB   r\   r(   r   s       rC   _set_url_connection_attemptsz*URLParameters._set_url_connection_attempts.  sj    	"%e** 	 	 	*   	
 $7   r   c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )r   zInvalid frame_max value r   N)r   rZ   r,   )rB   r\   r,   r   s       rC   _set_url_frame_maxz URLParameters._set_url_frame_max9  se    	E

II 	 	 	*   	
 #r   c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )r   zInvalid heartbeat value r   N)r   rZ   r.   )rB   r\   heartbeat_timeoutr   s       rC   _set_url_heartbeatz URLParameters._set_url_heartbeatD  sg    	 #E

 	 	 	*   	
 +r   c                     || _         dS r   )r2   r[   s     rC   _set_url_localezURLParameters._set_url_localeO  s    rE   c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )r   zInvalid retry_delay value r   N)r   rZ   r6   )rB   r\   r6   r   s       rC   _set_url_retry_delayz"URLParameters._set_url_retry_delayS  sh    	,,KK 	 	 	*   	
 'r   c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )r   zInvalid socket_timeout value r   N)r   rZ   r8   )rB   r\   r8   r   s       rC   _set_url_socket_timeoutz%URLParameters._set_url_socket_timeout^  sh    	"5\\NN 	 	 	*   	
 -r   c                     	 t          |          }n'# t          $ r}t          d|d|          d}~ww xY w|| _        dS )r   zInvalid stack_timeout value r   N)r   rZ   r:   )rB   r\   r:   r   s       rC   _set_url_stack_timeoutz$URLParameters._set_url_stack_timeouti  sh    	!%LLMM 	 	 	*   	
 +r   c                 ^   t          j        |          }|| j        t          d          dS 	 t          j        }n# t          $ r t          j        }Y nw xY wd|v r|d         }t	          j        |          }|	                    d          p|	                    d          }|	                    d          p|	                    d          }|	                    d	          p|	                    d
          }|
                    |||           d|v rI|d         }|	                    d          }	|	                    d          }
|                    ||	|
           d|v r|d         }|                    |           |	                    d          }t          j        ||          | _        dS )zBDeserialize and apply the corresponding query string arg

        NzWSpecified ssl_options=None URI arg is inconsistent with the specified amqps URI scheme.protocol)r   ca_certscafileca_pathcapathca_datacadatacertfilekeyfiler   ciphersserver_hostnamer   r   )r   r   r<   rZ   r   PROTOCOL_TLS_CLIENTr   PROTOCOL_TLSv1_2
SSLContextgetload_verify_locationsload_cert_chainset_ciphersra   r   )rB   r\   optsopt_protocolcxt
opt_cafile
opt_capath
opt_cadataopt_certfileopt_keyfileopt_passwordopt_ciphersr   s                rC   _set_url_ssl_optionsz"URLParameters._set_url_ssl_optionst  s    &&<+ 67 7 7 ,+4"6! 4 4 4"34T!!#J/.,777C*--C(1C1CJ),,B0B0BJ),,B0B0BJ%%j*jIII T!!#J/"hhy11#xx
33##L+|LLLD  "9o,,,"hh'899O#_ >  >  >Ds   = AAc                 8    t          j        |          | _        dS r   )r   r   r@   r[   s     rC   _set_url_tcp_optionsz"URLParameters._set_url_tcp_options  s    +E22rE   )rJ   r   r   r   r   r   rD   r   r   r   r   r   r   r   r   r   r   r   r  r   r   s   @rC   r   r     s       2 2j +I !NB B B B BH
E 
E 
E	' 	' 	'9 9 9	7 	7 	7	# 	# 	#	+ 	+ 	+  	' 	' 	'	- 	- 	-	+ 	+ 	+.> .> .>`3 3 3 3 3 3 3rE   r   c                       e Zd ZdZdZddZdS )r   zdClass used to provide parameters for optional fine grained control of SSL
    socket wrapping.

    r   Nc                     t          |t          j                  s"t          d                    |                    || _        || _        dS )z
        :param ssl.SSLContext context: SSLContext instance
        :param str|None server_hostname: SSLContext.wrap_socket, used to enable
            SNI
        z4context must be of ssl.SSLContext type, but got {!r}N)rN   r   r   rY   formatr   r   )rB   r   r   s      rC   rD   zSSLOptions.__init__  sW     '3>22 	FMM    .rE   r    )rJ   r   r   r   r   rD   r   rE   rC   r   r     s9          /I/ / / / / /rE   r   c                   h   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZedede	de
dededediZ	 	 	 	 	 d`dZd Zd Zd Zd Zd ZdadZdbdZdcdZddd Zed!             Zed"             Zed#             Zed$             Zed%             Zed&             Zed'             Z e!j"        d(             Z#e!j"        d)             Z$e!j"        d*             Z%e!j"        d+             Z&e!j"        d,             Z'e!j"        d-             Z(d. Z)d/ Z*d0 Z+d1 Z,ed2             Z-d3 Z.d4 Z/d5 Z0d6 Z1d7 Z2d8 Z3d9 Z4d: Z5d; Z6d< Z7d= Z8d> Z9d? Z:d@ Z;dA Z<dB Z=dC Z>dD Z?dE Z@dF ZAdG ZBdH ZCdI ZDeEdJ             ZFeEdK             ZGdL ZHdM ZIdN ZJdO ZKdP ZLdQ ZMdR ZNdS ZO	 	 dbdTZPdU ZQdV ZRdW ZSdX ZTdY ZUdcdZZVd[ ZWd\ ZXd] ZYd^ ZZd_ Z[dS )e
ConnectionzThis is the core class that implements communication with RabbitMQ. This
    class should not be invoked directly but rather through the use of an
    adapter such as SelectConnection or BlockingConnection.

    _on_connection_closed_on_connection_error_on_connection_open_okr   r         r         CLOSEDINITPROTOCOLSTARTTUNEOPENCLOSINGNTc                 0   | j         | _        d| _        d| _        d| _        d| _        |H|j        }d|_        	 t          j        |          | _	        || j	        _        ||_        n# ||_        w xY wt                      | _	        || _        t          j                                        | _        d| _        d| _        d| _        d| _        d| _        d| _        |                                  | j                            d| j        |p| j        d           |r|                     |           |r|                     |           |                     | j                   | j        r|                                  dS t>                               d           dS )ae  Connection initialization expects an object that has implemented the
         Parameters class and a callback function to notify when we have
         successfully connected to the AMQP Broker.

        Available Parameters classes are the ConnectionParameters class and
        URLParameters class.

        :param pika.connection.Parameters parameters: Read-only connection
            parameters.
        :param callable on_open_callback: Called when the connection is opened:
            on_open_callback(connection)
        :param None | method on_open_error_callback: Called if the connection
            can't be established or connection establishment is interrupted by
            `Connection.close()`: on_open_error_callback(Connection, exception).
        :param None | method on_close_callback: Called when a previously fully
            open connection is closed:
            `on_close_callback(Connection, exception)`, where `exception` is
            either an instance of `exceptions.ConnectionClosed` if closed by
            user or broker or exception of another type that describes the cause
            of connection failure.
        :param bool internal_connection_workflow: True for autonomous connection
            establishment which is default; False for externally-managed
            connection workflow via the `create_connection()` factory.

        FNr   z#Using external connection workflow.)!CONNECTION_CLOSEDconnection_state_opened_error_blocked_conn_timer_heartbeat_checkerr<   rh   ri   paramsr   _internal_connection_workflowra   callbackCallbackManager	callbacksserver_capabilitiesserver_properties_body_max_lengthknown_hosts_frame_buffer	_channels_init_connection_stateaddON_CONNECTION_ERROR_default_on_connection_erroradd_on_open_callbackadd_on_close_callback_set_connection_stateCONNECTION_INIT_adapter_connect_streamLOGGERdebug)rB   
parameterson_open_callbackon_open_error_callbackon_close_callbackinternal_connection_workflowsaved_ssl_optionss          rC   rD   zConnection.__init__  s   > !% 6   $( "& ! !+ 6%)J";"mJ77*;'):
&&):
&::::.00DK-I* 6688 $( !% $!##%%% 	t')? *.-u	6 	6 	6
  	8%%&6777  	:&&'8999""4#7888- 	@ ((***** LL>?????s   %A' '	A0c                 D   |                      | j                   d| _        t                      | _        t                      | _        d| _        d| _        d| _	        d| _
        d| _        d| _        |                                  | j                            dt           j        j        | j                   | j        j        ^| j        !|                     | j                   d| _        |                     | j                   |                     | j                   dS dS )zInitialize or reset all of the internal state variables for a given
        connection. On disconnect or reconnect all of the state needs to
        be wiped.

        Nr   )r.  r  r#  bytesr&  rf   r'  
bytes_sentbytes_receivedframes_sentframes_receivedr  r  _add_connection_start_callbackr!  r)  rr   r  Close _on_connection_close_from_brokerr  r"   r  _adapter_remove_timeout"add_on_connection_blocked_callback_on_connection_blocked$add_on_connection_unblocked_callback_on_connection_unblockedrA   s    rC   r(  z!Connection._init_connection_stateF  s2    	""4#9::: "& #WW   "&  	++--- 	1do3@	B 	B 	B ;1='3 ,,T-EFFF+/(33D4OPPP55-/ / / / / >=rE   c                 r    t          j        |           | j                            d| j        |d           dS )a  Add a callback notification when the connection has closed. The
        callback will be passed the connection and an exception instance. The
        exception will either be an instance of `exceptions.ConnectionClosed` if
        a fully-open connection was closed by user or broker or exception of
        another type that describes the cause of connection closure/failure.

        :param callable callback: Callback to call on close, having the signature:
            callback(pika.connection.Connection, exception)

        r   FN)rz   require_callbackr!  r)  ON_CONNECTION_CLOSEDrB   r  s     rC   r-  z Connection.add_on_close_callback}  s:     	#H---1d75IIIIIrE   c                     t          j        |           | j                            dt          j        j        t          j        ||           d           dS )ae  RabbitMQ AMQP extension - Add a callback to be notified when the
        connection gets blocked (`Connection.Blocked` received from RabbitMQ)
        due to the broker running low on resources (memory or disk). In this
        state RabbitMQ suspends processing incoming data until the connection
        is unblocked, so it's a good idea for publishers receiving this
        notification to suspend publishing until the connection becomes
        unblocked.

        See also `Connection.add_on_connection_unblocked_callback()`

        See also `ConnectionParameters.blocked_connection_timeout`.

        :param callable callback: Callback to call on `Connection.Blocked`,
            having the signature `callback(connection, pika.frame.Method)`,
            where the method frame's `method` member is of type
            `pika.spec.Connection.Blocked`

        r   Fone_shotN)	rz   rH  r!  r)  rr   r  Blocked	functoolspartialrJ  s     rC   rC  z-Connection.add_on_connection_blocked_callback  s\    & 	#H---O#h--	 	 	 	 	 	 	rE   c                     t          j        |           | j                            dt          j        j        t          j        ||           d           dS )a  RabbitMQ AMQP extension - Add a callback to be notified when the
        connection gets unblocked (`Connection.Unblocked` frame is received from
        RabbitMQ) letting publishers know it's ok to start publishing again.

        :param callable callback: Callback to call on
            `Connection.Unblocked`, having the signature
            `callback(connection, pika.frame.Method)`, where the method frame's
            `method` member is of type `pika.spec.Connection.Unblocked`

        r   FrL  N)	rz   rH  r!  r)  rr   r  	UnblockedrO  rP  rJ  s     rC   rE  z/Connection.add_on_connection_unblocked_callback  s\     	#H---O%h--	 	 	 	 	 	 	rE   c                 r    t          j        |           | j                            d| j        |d           dS )zAdd a callback notification when the connection has opened. The
        callback will be passed the connection instance as its only arg.

        :param callable callback: Callback to call when open

        r   FN)rz   rH  r!  r)  ON_CONNECTION_OPEN_OKrJ  s     rC   r,  zConnection.add_on_open_callback  s:     	#H---1d8(EJJJJJrE   c                     t          j        |           |r&| j                            d| j        | j                   | j                            d| j        |d           dS )a  Add a callback notification when the connection can not be opened.

        The callback method should accept the connection instance that could not
        connect, and either a string or an exception as its second arg.

        :param callable callback: Callback to call when can't connect, having
            the signature _(Connection, Exception)
        :param bool remove_default: Remove default exception raising callback

        r   FN)rz   rH  r!  remover*  r+  r)  )rB   r  remove_defaults      rC   add_on_open_error_callbackz%Connection.add_on_open_error_callback  sm     	#H--- 	EN!!!T%="&"CE E E1d6%HHHHHrE   c                 P   | j         st          j        d| z            t          j        |           |s|                                 }|                     ||          | j        |<   |                     |           | j        |         	                                 | j        |         S )aU  Create a new channel with the next available channel number or pass
        in a channel number to use. Must be non-zero if you would like to
        specify but it is recommended that you let Pika manage the channel
        numbers.

        :param int channel_number: The channel number to use, defaults to the
                                   next available.
        :param callable on_open_callback: The callback when the channel is
            opened.  The callback will be invoked with the `Channel` instance
            as its only argument.
        :rtype: pika.channel.Channel

        z2Channel allocation requires an open connection: %s)
is_open
exceptionsConnectionWrongStateErrorrz   rpc_completion_callback_next_channel_number_create_channelr'  _add_channel_callbacksopenrB   channel_numberr4  s      rC   rb   zConnection.channel  s     | 	M6DtKM M M 	*+;<<< 	9!6688N)-)=)=,*. *.~&##N333~&++---~n--rE   c                     | j         st          j        d| z            t          j        |           |                     dt          j                            ||          |t          j        j	        g           dS )a  RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection. 
        It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
        Pass a callback to be notified of the response from the server.

        :param string new_secret: The new secret
        :param string reason: The reason for the secret update
        :param callable callback: Callback to call on
            `Connection.UpdateSecretOk`, having the signature
            `callback(pika.frame.Method)`, where the method frame's
            `method` member is of type `pika.spec.Connection.UpdateSecretOk`

        :raises pika.exceptions.ConnectionWrongStateError: if connection is
            not open.
        z-Secret update requires an open connection: %sr   N)
rZ  r[  r\  rz   r]  _rpcrr   r  UpdateSecretUpdateSecretOk)rB   
new_secretreasonr  s       rC   update_secretzConnection.update_secret  s     | 	H6?$FH H H 	*8444		!T_11*fEET_;<	> 	> 	> 	> 	>rE      Normal shutdownc                 $   | j         s| j        rVd                    ||| | j        | j                           }t
                              |           t          j        |          | j	        r| 
                    ||           | j        }|                     | j                   t
                              d||           | j        set
                              d           t          j        d                    | j        |         ||                    }|                     |           dS t          j        ||          | _        | j	        s|                                  dS t
                              dt)          | j	                  |            dS )a  Disconnect from RabbitMQ. If there are any open channels, it will
        attempt to close them prior to fully disconnecting. Channels which
        have active consumers will attempt to send a Basic.Cancel to RabbitMQ
        to cleanly stop the delivery of messages prior to closing the channel.

        :param int reply_code: The code number for the close
        :param str reply_text: The text reason for the close

        :raises pika.exceptions.ConnectionWrongStateError: if connection is
            closed or closing.
        zVIllegal close({}, {!r}) request on {} because it was called while connection state={}.zClosing connection (%s): %rzhConnection.close() is terminating stream and bypassing graceful AMQP close, since AMQP is still opening.zVConnection.close() called before connection finished opening: prev_state={} ({}): {!r}z8Connection.close is waiting for %d channels to close: %sN)
is_closing	is_closedr  _STATE_NAMESr  r1  errorr[  r\  r'  _close_channelsr.  CONNECTION_CLOSINGinfor  ConnectionOpenAborted_terminate_streamConnectionClosedByClientr  _on_close_readyr   )rB   
reply_code
reply_textmsg
prev_staterq  s         rC   closezConnection.close  s    ? 	<dn 	<;;A6!:t()>?<A <A  LL6s;;;
 > 	9  Z888*
 	""4#:;;;1:zJJJ| 	/ KK # $ $ $ 4==CV%j1:z>K >KL LE ""5))))) %=J( (DK > / $$&&&&&N''/ / / / /rE   c                 "    | j         | j        k    S zK
        Returns a boolean reporting the current connection state.
        )r  r  rA   s    rC   ro  zConnection.is_closedG  s    
 $(>>>rE   c                 "    | j         | j        k    S )z
        Returns True if connection is in the process of closing due to
        client-initiated `close` request, but closing is not yet complete.
        )r  rs  rA   s    rC   rn  zConnection.is_closingN  s     $(???rE   c                 "    | j         | j        k    S r  )r  CONNECTION_OPENrA   s    rC   rZ  zConnection.is_openV  s    
 $(<<<rE   c                 8    | j                             dd          S )zeSpecifies if the server supports basic.nack on the active connection.

        :rtype: bool

        
basic.nackFr"  r   rA   s    rC   
basic_nackzConnection.basic_nacka  s     '++L%@@@rE   c                 8    | j                             dd          S )zSpecifies if the server supports consumer cancel notification on the
        active connection.

        :rtype: bool

        consumer_cancel_notifyFr  rA   s    rC   r  z!Connection.consumer_cancel_notifyj  s     '++,DeLLLrE   c                 8    | j                             dd          S )zrSpecifies if the active connection supports exchange to exchange
        bindings.

        :rtype: bool

        exchange_exchange_bindingsFr  rA   s    rC   r  z%Connection.exchange_exchange_bindingst  s     '++,H%PPPrE   c                 8    | j                             dd          S )zcSpecifies if the active connection can use publisher confirmations.

        :rtype: bool

        publisher_confirmsFr  rA   s    rC   r  zConnection.publisher_confirms~  s     '++,@%HHHrE   c                     t           )a  Adapters should override to call the callback after the
        specified number of seconds have elapsed, using a timer, or a
        thread, or similar.

        :param float|int delay: The number of seconds to wait to call callback
        :param callable callback: The callback will be called without args.
        :returns: Handle that can be passed to `_adapter_remove_timeout()` to
            cancel the callback.
        :rtype: object

        NotImplementedError)rB   delayr  s      rC   _adapter_call_laterzConnection._adapter_call_later  s
     "!rE   c                     t           )ztAdapters should override: Remove a timeout

        :param opaque timeout_id: The timeout handle to remove

        r  )rB   
timeout_ids     rC   rB  z"Connection._adapter_remove_timeout  s
     "!rE   c                     t           )a  Requests a call to the given function as soon as possible in the
        context of this connection's IOLoop thread.

        NOTE: This is the only thread-safe method offered by the connection. All
         other manipulations of the connection must be performed from the
         connection's thread.

        :param callable callback: The callback method; must be callable.

        r  rJ  s     rC    _adapter_add_callback_threadsafez+Connection._adapter_add_callback_threadsafe  s
     "!rE   c                     t           )a3  Subclasses should override to initiate stream connection
        workflow asynchronously. Upon failed or aborted completion, they must
        invoke `Connection._on_stream_terminated()`.

        NOTE: On success, the stack will be up already, so there is no
              corresponding callback.

        r  rA   s    rC   r0  z"Connection._adapter_connect_stream  
     "!rE   c                     t           )zAsynchronously bring down the streaming transport layer and invoke
        `Connection._on_stream_terminated()` asynchronously when complete.

        :raises: NotImplementedError

        r  rA   s    rC   _adapter_disconnect_streamz%Connection._adapter_disconnect_stream  s
     "!rE   c                     t           )zTake ownership of data and send it to AMQP server as soon as
        possible.

        Subclasses must override this

        :param bytes data:

        r  )rB   datas     rC   _adapter_emit_datazConnection._adapter_emit_data  r  rE   c                 P    | j         |                             | j                   dS )zAdd the appropriate callbacks for the specified channel number.

        :param int channel_number: The channel number for the callbacks

        N)r'  _add_on_cleanup_callback_on_channel_cleanup)rB   rc  s     rC   r`  z!Connection._add_channel_callbacks  s3     	~&??$	& 	& 	& 	& 	&rE   c                 f    | j                             dt          j        j        | j                   dS )z_Add a callback for when a Connection.Start frame is received from
        the broker.

        r   N)r!  r)  rr   r  Start_on_connection_startrA   s    rC   r?  z)Connection._add_connection_start_callback  s,    
 	1do3T5NOOOOOrE   c                 f    | j                             dt          j        j        | j                   dS )z<Add a callback for when a Connection.Tune frame is received.r   N)r!  r)  rr   r  Tune_on_connection_tunerA   s    rC   _add_connection_tune_callbackz(Connection._add_connection_tune_callback  s*    1do2D4LMMMMMrE   c                     |j         j        |j         j        ft          j        dd         k    r&t          j        t          j                    |          dS )zInvoked when starting a connection to make sure it's a supported
        protocol.

        :param pika.frame.Method value: The frame to check
        :raises: ProtocolVersionMismatch

        r   r  N)	methodversion_majorversion_minorrr   PROTOCOL_VERSIONr[  ProtocolVersionMismatchframeProtocolHeaderr[   s     rC   _check_for_protocol_mismatchz'Connection._check_for_protocol_mismatch  s\     \')CD%ac*+ +4U5I5K5K5:< < <+ +rE   c                     t           dt          j                    z  dddddddt          j        d}| j        j        r|                    | j        j                   |S )zHReturn the client properties dictionary.

        :rtype: dict

        z	Python %sT)authentication_failure_closer  zconnection.blockedr  r  zSee http://pika.rtfd.org)productplatformcapabilitiesinformationversion)PRODUCTr  python_versionra   __version__r  r&   update)rB   
propertiess     rC   r   zConnection._client_properties  sv     #h&=&?&??04"&**.&*  6'
 

 ;( 	=dk;<<<rE   c                     | j         sJ t          |                       t          | j                  D ]3}| j        |         }|j        s|j        s|                    ||           4dS )a  Initiate graceful closing of channels that are in OPEN or OPENING
        states, passing reply_code and reply_text.

        :param int reply_code: The code for why the channels are being closed
        :param str reply_text: The text reason for why the channels are closing

        N)rZ  strr   r'  rn  ro  r}  )rB   ry  rz  rc  chans        rC   rr  zConnection._close_channels  sw     |&&SYY&&&&t~66 	3 	3N>.1DO 3t~ 3

:z222	3 	3rE   c                 z    t                               d|           t          j                            | ||          S )a|  Create a new channel using the specified channel number and calling
        back the method specified by on_open_callback

        :param int channel_number: The channel number to use
        :param callable on_open_callback: The callback when the channel is
            opened.  The callback will be invoked with the `Channel` instance
            as its only argument.

        zCreating channel %s)r1  r2  ra   rb   Channelrb  s      rC   r_  zConnection._create_channel!  s4     	*N;;;|##D.:JKKKrE   c                     | j         j        _| j         j        dk    rOt                              d| j         j                   t          j                            | | j         j                  S dS )zCreate a heartbeat checker instance if there is a heartbeat interval
        set.

        :rtype: pika.heartbeat.Heartbeat|None

        Nr   zCreating a HeartbeatChecker: %r)r  r.   r1  r2  ra   HeartbeatCheckerrA   s    rC   _create_heartbeat_checkerz$Connection._create_heartbeat_checker.  sa     ; ,1F1J1JLL:.0 0 0>2249NOOOtrE   c                 X    | j         r"| j                                          d| _         dS dS )z1Stop the heartbeat checker if it exists

        N)r  stoprA   s    rC   _remove_heartbeatzConnection._remove_heartbeat<  s<     " 	+#((***&*D###	+ 	+rE   c                     |j         | j        vr)t                              d|j        |j         |            dS | j        |j                                      |           dS )zDeliver the frame to the channel specified in the frame.

        :param pika.frame.Method value: The frame to deliver

        z3Received %s frame for unregistered channel %i on %sN)rc  r'  r1  criticalNAME_handle_content_framer[   s     rC   _deliver_frame_to_channelz$Connection._deliver_frame_to_channelD  sh     #t~55 OOE
E0$8 8 8 F 	u+,BB5IIIIIrE   c                 @    | j         r|                                  dS dS )z*If the connection is not closed, close it.N)rZ  r}  rA   s    rC   _ensure_closedzConnection._ensure_closedU  s'    < 	JJLLLLL	 	rE   c                 N    | j         j        t          j        z
  t          j        z
  S )zaCalculate the maximum amount of bytes that can be in a body frame.

        :rtype: int

        )r  r,   rr   FRAME_HEADER_SIZEFRAME_END_SIZErA   s    rC   _get_body_frame_max_lengthz%Connection._get_body_frame_max_lengthZ  s$     %(>>#$ 	%rE   c                     | j         j                            |j                  \  }}|s#t	          j        | j         j        j                  | j         j                                         ||fS )zGet credentials for authentication.

        :param pika.frame.MethodFrame method_frame: The Connection.Start frame
        :rtype: tuple(str, str)

        )r  r*   response_forr  r[  AuthenticationErrorTYPEerase_credentials)rB   method_frame	auth_typeresponses       rC   _get_credentialszConnection._get_credentialsc  sk     [,99,:MNN		 	O01H1MNNN11333(""rE   c                 L    | j                             |j        |j                  S )zReturn true if there are any callbacks pending for the specified
        frame.

        :param pika.frame.Method value: The frame to check
        :rtype: bool

        )r!  pendingrc  r  r[   s     rC   _has_pending_callbacksz!Connection._has_pending_callbacksq  s!     ~%%e&:ELIIIrE   c                 6    t          |t          j                  S )zReturns true if the frame is a method frame.

        :param pika.frame.Frame value: The frame to evaluate
        :rtype: bool

        )rN   r  Methodr[   s     rC   _is_method_framezConnection._is_method_frame{  s     %...rE   c                 6    t          |t          j                  S )zMReturns True if it's a protocol header frame.

        :rtype: bool

        )rN   r  r  r[   s     rC   _is_protocol_header_framez$Connection._is_protocol_header_frame  s     %!5666rE   c                 *   | j         j        pt          j        j        }t          | j                  |k    rt          j                    t          dt          | j                  dz             D ]}|| j        vr|c S t          | j                  dz   S )z^Return the next available channel number or raise an exception.

        :rtype: int

        r   )
r  r$   ra   rb   rc   r   r'  r[  NoFreeChannelsr   )rB   limitnums      rC   r^  zConnection._next_channel_number  s     'D4<+Dt~%''+---!S001455 	 	C$.((


 )4>""Q&&rE   c                    	 | j         |j        = t                              d|j                   n0# t          $ r# t                              d|j                   Y nw xY w| j        rZ| j         s|                                  dS d t          | j                   D             }|rt          	                    d|           dS dS dS )zRemove the channel from the dict of channels when Channel.CloseOk is
        sent. If connection is closing and no more channels remain, proceed to
        `_on_close_ready`.

        :param pika.channel.Channel channel: channel instance

        zRemoved channel %szChannel %r not in channelsc                      g | ]}|j         	|S r   )rn  ).0r  s     rC   
<listcomp>z2Connection._on_channel_cleanup.<locals>.<listcomp>  s0     1 1 1!?11 1 1rE   z8Connection in CLOSING state has non-CLOSING channels: %rN)
r'  rc  r1  r2  KeyErrorrq  rn  rx  r   r  )rB   rb   channels_not_in_closing_states      rC   r  zConnection._on_channel_cleanup  s   	Ow56LL-w/EFFFF 	O 	O 	OLL5w7MNNNNN	O? 	G> G$$&&&&&
1 1%4T^%D%D1 1 1- 1 GOO'(EG G G G G	G 	GG Gs   -0 *AAc                     | j         rt                              d           dS |                     | j        j        | j        j                   dS )zCalled when the Connection is in a state that it can close after
        a close has been requested by client. This happens after all of the
        channels are closed that were open when the close request was made.

        z+_on_close_ready invoked when already closedN)ro  r1  warning_send_connection_closer  ry  rz  rA   s    rC   rx  zConnection._on_close_ready  sY     > 	NNHIIIF 	##DK$:$(K$:	< 	< 	< 	< 	<rE   c                     |                      | j                   |                     t          j                               dS )zlInvoked when the socket is connected and it's time to start speaking
        AMQP with the broker.

        N)r.  CONNECTION_PROTOCOL_send_framer  r  rA   s    rC   _on_stream_connectedzConnection._on_stream_connected  s@    
 	""4#;<<< 	-//00000rE   c                 b    d| _         |                     t          j        d                     dS )zw Called when the "connection blocked timeout" expires. When this
        happens, we tear down the connection

        Nz#Blocked connection timeout expired.)r  rv  r[  ConnectionBlockedTimeoutrA   s    rC   _on_blocked_connection_timeoutz)Connection._on_blocked_connection_timeout  sA    
 $( /57 7	8 	8 	8 	8 	8rE   c                     t                               d|           | j        "t                               d| j                   dS |                     | j        j        | j                  | _        dS )zHandle Connection.Blocked notification from RabbitMQ broker

        :param pika.frame.Method method_frame: method frame having `method`
            member of type `pika.spec.Connection.Blocked`
        Received %s from brokerNzH_blocked_conn_timer %s already set when _on_connection_blocked is called)r1  r  r  r  r  r"   r  rB   _connectionr  s      rC   rD  z!Connection._on_connection_blocked  s     	0,???#/ NN3484LN N N N N (,'?'?63(5 (5D$$$rE   c                     t                               d|           | j        t                               d           dS |                     | j                   d| _        dS )zHandle Connection.Unblocked notification from RabbitMQ broker

        :param pika.frame.Method method_frame: method frame having `method`
            member of type `pika.spec.Connection.Blocked`
        r  NzG_blocked_conn_timer was not active when _on_connection_unblocked called)r1  rt  r  r  rB  r  s      rC   rF  z#Connection._on_connection_unblocked  sp     	-|<<<#+ NN = > > > > > (()ABBB'+D$$$rE   c                     t                               d|           |                     t          j        |j        j        |j        j                             dS )zCalled when the connection is closed remotely via Connection.Close
        frame from broker.

        :param pika.frame.Method method_frame: The Connection.Close frame

        z*_on_connection_close_from_broker: frame=%sN)r1  r2  rv  r[  ConnectionClosedByBrokerr  ry  rz  rB   r  s     rC   rA  z+Connection._on_connection_close_from_broker  sc     	A<PPP/0C0N0<0C0NP P	Q 	Q 	Q 	Q 	QrE   c                 f    t                               d|           |                     d           dS )zCalled when Connection.CloseOk is received from remote.

        :param pika.frame.Method method_frame: The Connection.CloseOk frame

        z!_on_connection_close_ok: frame=%sN)r1  r2  rv  r  s     rC   _on_connection_close_okz"Connection._on_connection_close_ok  s3     	8,GGGt$$$$$rE   c                     |)zDefault behavior when the connecting connection cannot connect and
        user didn't supply own `on_connection_error` callback.

        :raises: the given error

        r   )rB   _connection_unusedrq  s      rC   r+  z'Connection._default_on_connection_error  s	     rE   c                     d| _         |j        j        | _        |                     | j                   | j                            d| j        | |            dS )z
        This is called once we have tuned the connection with the server and
        called the Connection.Open on the server and it has replied with
        Connection.Ok.
        Tr   N)r  r  r%  r.  r  r!  processrT  r  s     rC   r
  z!Connection._on_connection_open_ok  sY     '.: 	""4#7888 	q$"<dDIIIIIrE   c                    |                      | j                   	 |                     |          rt          j        |          |                     |           |                     |           |                                   | j        | 	                    |            dS # t          $ r:}t                              d           |                     |           Y d}~dS d}~ww xY w)zThis is called as a callback once we have received a Connection.Start
        from the server.

        :param pika.frame.Method method_frame: The frame received
        :raises: UnexpectedFrameError

        z"Error processing Connection.Start.N)r.  CONNECTION_STARTr  r[  UnexpectedFrameErrorr  _set_server_informationr  _send_connection_start_okr  	Exceptionr1  	exceptionrv  )rB   r  rq  s      rC   r  zConnection._on_connection_start/  s     	""4#8999		*--l;; D 5lCCC--l;;;((666..000*D*D,A,A,,O,OPPPP 	* 	* 	*ABBB""5)))))))))	*s   BB" "
C&,/C!!C&c                 p    | d} |d}| dk    s|dk    rt          | |          }nt          | |          }|S )a  Negotiates two values. If either of them is 0 or None,
        returns the other one. If both are positive integers, returns the
        smallest one.

        :param int client_value: The client value
        :param int server_value: The server value
        :rtype: int

        Nr   )maxmin)client_valueserver_valuevals      rC   _negotiate_integer_valuez#Connection._negotiate_integer_valueD  sV     LL 1 1 1lL11CClL11C
rE   c                     | |}n| }|S )a5   Determine heartbeat timeout per AMQP 0-9-1 rules

        Per https://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf,

        > Both peers negotiate the limits to the lowest agreed value as follows:
        > - The server MUST tell the client what limits it proposes.
        > - The client responds and **MAY reduce those limits** for its
            connection

        If the client specifies a value, it always takes precedence.

        :param client_value: None to accept server_value; otherwise, an integral
            number in seconds; 0 (zero) to disable heartbeat.
        :param server_value: integral value of the heartbeat timeout proposed by
            broker; 0 (zero) to disable heartbeat.

        :returns: the value of the heartbeat timeout to use and return to broker
        :rtype: int
        r   )r  r  timeouts      rC   _tune_heartbeat_timeoutz"Connection._tune_heartbeat_timeout]  s    * "GG"GrE   c                    |                      | j                   t                              | j        j        |j        j                  | j        _        t                              | j        j        |j        j                  | j        _        t          | j        j	                  rT| j        	                    | |j        j	                  }|t          |          rt          d|          || j        _	        |                     | j        j	        |j        j	                  | j        _	        |                                 | _        |                                 | _        |                                  |                                  dS )aF  Once the Broker sends back a Connection.Tune, we will set our tuning
        variables that have been returned to us and kick off the Heartbeat
        monitor if required, send our TuneOk and then the Connection. Open rpc
        call on channel 0.

        :param pika.frame.Method method_frame: The frame received

        Nz=heartbeat callback must not return None or callable, but got )r  r  )r.  CONNECTION_TUNEr  r  r  r$   r  r,   rw   r.   rY   r  r  r$  r  r  _send_connection_tune_ok_send_connection_open)rB   r  ret_heartbeats      rC   r  zConnection._on_connection_tunez  s}    	""4#7888 #-"E"EK#\%8%D#F #F * C CK!<#6#@!B !B DK)** 		2 K11$2>2E2OQ QM$(?(?$i=J]!M N N N %2DK! !% < <.%,6 != !8 !8
 !% ? ? A A #'"@"@"B"B 	%%''' 	""$$$$$rE   c                     | xj         |z  c_         | j         rN|                                 \  }}|sdS |                     |           |                     |           | j         LdS dS )zThis is called by our Adapter, passing in the data from the socket.
        As long as we have buffer try and map out frame data.

        :param str data_in: The data that is available to read

        N)r&  _read_frame_trim_frame_buffer_process_frame)rB   data_inconsumed_countframe_values       rC   _on_data_availablezConnection._on_data_available  s     	g%  	-*.*:*:*<*<'NK ##N333,,,   	- 	- 	- 	- 	-rE   c                    t          |t          d          t          f          sJ d                    |                      ||| _        n| j        
J d            |                                  |                                  dS )a  Deactivate heartbeat instance if activated already, and initiate
        termination of the stream (TCP) connection asynchronously.

        When connection terminates, the appropriate user callback will be
        invoked with the given error: "on open error" or "on connection closed".

        :param Exception | None error: exception instance describing the reason
            for termination; None for normal closing, such as upon receipt of
            Connection.CloseOk.

        Nz:error arg is neither None nor instance of Exception: {!r}.zN_terminate_stream() expected self._error to be set when passed None error arg.)rN   rg   r
  r  r  r  r  )rB   rq  s     rC   rv  zConnection._terminate_stream  s     %$t**i!899 	 	HOO 	 	 	 DKK;**) +**
 	    	'')))))rE   c                    t                               d| j        || j                   |0| j        !t                               d| j        |           || _        n| j        
J d            |                                  |                     dt          j        j	        t          j        j
        g           | j        j        6|                     dt          j        j        t          j        j        g           | j        sit          | j        t           j        t           j        f          r=| j        | j        k    rFt                               d           t!          j        t/          | j                            | _        n| j        | j        k    rFt                               d           t!          j        t/          | j                            | _        n| j        | j        k    rFt                               d           t!          j        t/          | j                            | _        n;| j        | j        | j        | j        fvr t                               d	| j                   |                      | j                   tC          | j"                  D ]1}|| j"        vr| j"        |         #                    | j                   2| j        sIt                               d
| j                   | j$        %                    d| j&        | | | j                   nHt                               d| j                   | j$        %                    d| j'        | | | j                   | (                                 dS )a  Handle termination of stack (including TCP layer) or failure to
        establish the stack. Notify registered ON_CONNECTION_ERROR or
        ON_CONNECTION_CLOSED callbacks, depending on whether the connection
        was opening or open.

        :param Exception | None error: None means that the transport was aborted
            internally and exception in `self._error` represents the cause.
            Otherwise it's an exception object that describes the unexpected
            loss of connection.

        z_AMQP stack terminated, failed to connect, or aborted: opened=%r, error-arg=%r; pending-error=%rNz<_on_stream_terminated(): overriding pending-error=%r with %rz__on_stream_terminated() expected self._error to be populated with reason for terminating stack.r   z'Probably incompatible Protocol VersionszQConnection closed while authenticating indicating a probable authentication errorzrConnection closed while tuning the connection indicating a probable permission error when accessing a virtual hostz-Unexpected connection state on disconnect: %iz%Connection setup terminated due to %rzStack terminated due to %r))r1  rt  r  r  r2  r  _remove_callbacksrr   r  r@  r  r  r"   rN  rR  rN   r[  StreamLostErrorr  r  r  rq  IncompatibleProtocolErrorreprr  ProbableAuthenticationErrorr  ProbableAccessDeniedErrorr  r  rs  r  r.  r   r'  _on_close_metar!  r  r*  rI  r(  )rB   rq  rb   s      rC   _on_stream_terminatedz Connection._on_stream_terminated  s~    	8L%	. 	. 	.
 {&/04UD D D  DKK;**5 +**
 	    	q $ 5t7LM	O 	O 	O ;1=""1_,do.GHJ J J | 	6
4;+Z-PQ!S !S 	6 $(@@@FGGG(B%%' '&$*???45 5 5 )D%%' '&$*>>> 8 9 9 9 )B%%' '&($*@+/   N#46 6 6 	""4#9:::  // 	@ 	@Gdn,,N7#224;???? | 	0KK?MMMN""1d&>d#';0 0 0 0 KK4dkBBBN""1d&?t#';0 0 0 	##%%%%%rE   c                     |                      |          r>|                     |          r)| j                            |j        |j        | |           dS dS )zProcess the callbacks for the frame if the frame is a method frame
        and if it has any callbacks pending.

        :param pika.frame.Method frame_value: The frame to process
        :rtype: bool

        TF)r  r  r!  r  rc  r  rB   r!  s     rC   _process_callbackszConnection._process_callbacks-  sh     !!+.. 	++K88	N""*"	  
 4urE   c                 b   |j         dk     rdS | xj        dz  c_        |                     |          rdS t          |t          j                  r>| j        r| j                                         dS t          	                    d           dS |j
        dk    r|                     |           dS dS )zProcess an inbound frame from the socket.

        :param pika.frame.Frame|pika.frame.Method frame_value: The frame to
            process

        r   Nr   z4Received heartbeat frame without a heartbeat checker)
frame_typer>  r/  rN   r  	Heartbeatr  receivedr1  r  rc  r  r.  s     rC   r  zConnection._process_frame?  s     !A%%F 	! "";// 	F k5?33 		8& *'0022222  ) * * * * * '!++**;77777 ,+rE   c                 4    t          j        | j                  S )zoTry and read from the frame buffer and decode a frame.

        :rtype tuple: (int, pika.frame.Frame)

        )r  decode_framer&  rA   s    rC   r  zConnection._read_frame]  s     !$"4555rE   c                 `    |D ]*}| j                             t          |          |           +dS )a5  Remove the callbacks for the specified channel number and list of
        method frames.

        :param int channel_number: The channel number to remove the callback on
        :param sequence method_classes: The method classes (derived from
            `pika.amqp_object.Method`) for the callbacks

        N)r!  rV  r  )rB   rc  method_classes
method_clss       rC   r%  zConnection._remove_callbackse  sD     ) 	C 	CJN!!#n"5"5zBBBB	C 	CrE   c                     |r$t          |t                    st          d          |5t          j        |           |D ]}| j                            |||           |                     ||           dS )a  Make an RPC call for the given callback, channel number and method.
        acceptable_replies lists out what responses we'll process from the
        server with the specified callback.

        :param int channel_number: The channel number for the RPC call
        :param pika.amqp_object.Method method: The method frame to call
        :param callable callback: The callback for the RPC response
        :param list acceptable_replies: The replies this RPC call expects

        z)acceptable_replies should be list or NoneN)rN   listrY   rz   rH  r!  r)  _send_method)rB   rc  r  r  acceptable_repliesreplys         rC   re  zConnection._rpcq  s       	Ij1CT&J&J 	IGHHH '111+ D D"">5(CCCC 	.&11111rE   c           	          |                      dt          j                            ||dd          | j        t          j        j        g           dS )zSend a Connection.Close method frame.

        :param int reply_code: The reason for the close
        :param str reply_text: The text reason for the close

        r   N)re  rr   r  r@  r   CloseOk)rB   ry  rz  s      rC   r  z!Connection._send_connection_close  sS     			!T_**:z1aHH.1H0I	K 	K 	K 	K 	KrE   c                     |                      dt          j                            | j        j        d          | j        t          j        j        g           dS )zSend a Connection.Open framer   T)insistN)re  rr   r  Openr  r>   r
  OpenOkrA   s    rC   r  z Connection._send_connection_open  sX    		!T_))K$T * 3 3484O?)*	, 	, 	, 	, 	,rE   c           	          |                      dt          j                            | j        ||| j        j                             dS )zSend a Connection.StartOk frame

        :param str authentication_type: The auth type value
        :param str response: The encoded value to send

        r   N)r;  rr   r  StartOkr   r  r2   )rB   authentication_typer  s      rC   r	  z$Connection._send_connection_start_ok  sP     	O##D$;$7$(K$68 8	9 	9 	9 	9 	9rE   c                     |                      dt          j                            | j        j        | j        j        | j        j                             dS )zSend a Connection.TuneOk framer   N)r;  rr   r  TuneOkr  r$   r,   r.   rA   s    rC   r  z#Connection._send_connection_tune_ok  sS    O""4;#:#';#8#';#8: :	; 	; 	; 	; 	;rE   c                     | j         r.t                              d           t          j        d          |                                }|                     |g           dS )a+  This appends the fully generated frame to send to the broker to the
        output buffer which will be then sent via the connection adapter.

        :param pika.frame.Frame|pika.frame.ProtocolHeader frame_value: The
            frame to write
        :raises: exceptions.ConnectionClosed

        z#Attempted to send frame when closedz/Attempted to send a frame on closed connection.N)ro  r1  rq  r[  r\  marshal_output_marshaled_frames)rB   r!  marshaled_frames      rC   r  zConnection._send_frame  sm     > 	CLL>???6AC C C &--//%%&788888rE   c                     |r|                      |||           dS |                     t          j        ||                     dS )aH  Constructs a RPC method frame and then sends it to the broker.

        :param int channel_number: The channel number for the frame
        :param pika.amqp_object.Method method: The method to send
        :param tuple content: If set, is a content frame, is tuple of
                              properties and body.

        N)_send_messager  r  r  )rB   rc  r  contents       rC   r;  zConnection._send_method  sQ      	C~vw?????U\.&AABBBBBrE   c                    t          |d                   }g }t          j        ||          }t          j        |||d                   }|                    |                                           |                    |                                           |d         rt          t          j        t          |          | j
        z                      }t          d|          D ]h}	|	| j
        z  }
|
| j
        z   }||k    r|}t          j        ||d         |
|                   }|                    |                                           i|                     |           dS )a  Publish a message.

        :param int channel_number: The channel number for the frame
        :param pika.object.Method method_frame: The method frame to send
        :param tuple content: A content frame, which is tuple of properties and
                              body.

        r   r   N)r   r  r  HeaderappendrJ  r   mathceilr   r$  r   BodyrK  )rB   rc  r  rO  lengthmarshaled_body_framesframe_methodframe_headerchunkschunkstartend
frame_bodys                rC   rN  zConnection._send_message  sT    WQZ " |NLAA|NFGAJGG$$\%9%9%;%;<<<$$\%9%9%;%;<<<1: 	C5==43H#HIIJJF6** C C 55d33<< C"Z
598MNN
%,,Z-?-?-A-ABBBB%%&;<<<<<rE   c                     t                               d| j        |         | j        | j                            || _        dS )zeSet the connection state.

        :param int connection_state: The connection state to set

        z"New Connection state: %s (prev=%s)N)r1  r2  rp  r  )rB   r  s     rC   r.  z Connection._set_connection_state  sG     	9&'78&t'<=	? 	? 	? !1rE   c                     |j         j        | _        | j                            dt                                | _        t          | j        d          r
| j        d= dS dS )zSet the server properties and capabilities

        :param spec.connection.Start method_frame: The Connection.Start frame

        r  N)r  r#  r   rf   r"  hasattrr  s     rC   r  z"Connection._set_server_information  sf     ".!4!F#'#9#=#=DFF$$ $$ 4)>:: 	7&~666	7 	7rE   c                 N    | j         |d         | _         | xj        |z  c_        dS )zTrim the leading N bytes off the frame buffer and increment the
        counter that keeps track of how many bytes have been read/used from the
        socket.

        :param int byte_count: The number of bytes consumed

        N)r&  r<  )rB   
byte_counts     rC   r  zConnection._trim_frame_buffer	  s2     "/
<z)rE   c                     |D ]D}| xj         t          |          z  c_         | xj        dz  c_        |                     |           EdS )zOutput list of marshaled frames to buffer and update stats

        :param list marshaled_frames: A list of frames marshaled to bytes

        r   N)r;  r   r=  r  )rB   marshaled_framesrL  s      rC   rK  z#Connection._output_marshaled_frames	  s`      0 	5 	5OOOs?333OO!##O4444	5 	5rE   )NNNNT)T)NNr    )rk  rl  )\rJ   r   r   r   rI  r*  rT  r  r/  r  r  r  r  rs  rp  rD   r(  r-  rC  rE  r,  rX  rb   rj  r}  r   ro  rn  rZ  r  r  r  r  abcabstractmethodr  rB  r  r0  r  r  r`  r?  r  r  r   rr  r_  r  r  r  r  r  r  r  r  r  r^  r  rx  r  r  rD  rF  rA  r   r+  r
  r  staticmethodr  r  r  r"  rv  r,  r/  r  r  r%  re  r  r  r	  r  r  r;  rN  r.  r  r  rK  r   rE   rC   r  r    s+         304OOO 	8Z'IL !"&(,#'.2d@ d@ d@ d@L5/ 5/ 5/nJ J J  4  $K K KI I I I". . . .:> > > >.;/ ;/ ;/ ;/B ? ? X? @ @ X@ = = X= A A XA M M XM Q Q XQ I I XI 	" " " 	" " " 	" " "  		" 	" 	" 	" " " 		" 	" 	"& & &P P PN N N< < <   X23 3 3L L L  + + +J J J"  
% % %# # #J J J/ / /7 7 7' ' 'G G G<< < <1 1 18 8 85 5 5&, , ,"Q Q Q% % %  J J J * * **   \0   \8+% +% +%Z- - - * * *<V& V& V&p  $8 8 8<6 6 6
C 
C 
C  $	2 2 2 28K K K, , ,9 9 9; ; ;9 9 9"C C C C= = =>
1 
1 
1
7 
7 
7	* 	* 	*	5 	5 	5 	5 	5rE   r  ))r   rf  r   rh   rO  loggingrS  rW   r  r   pika.callbackra   pika.channelpika.compatpika.credentialspika.exceptionsr[  
pika.framer  pika.heartbeat	pika.specrr   pika.validatorsrz   r   r   r   r   r   r  	getLoggerrJ   r1  r   r	   r   r   r   r   AbstractBaser  r   rE   rC   <module>ru     sR     


 



          



                 $ $ $ $ $ $                 $ $ $ $ $ $              '		8	$	$o" o" o" o" o" o" o" o"dzA zA zA zA zA: zA zA zAzS3 S3 S3 S3 S3J S3 S3 S3l/ / / / / / / /0[5 [5 [5 [5 [5) [5 [5 [5 [5 [5rE   