[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.224.32.56: ~ $


�`Wn(�@s�ddlmZddlZddlZddlmZmZmZmZm	Z	ddl
mZeje
�ZGdd�de�Zed�e_dS)	�)�absolute_importN�)�ConnectTimeoutError�
MaxRetryError�
ProtocolError�ReadTimeoutError�
ResponseError)�sixc@s�eZdZdZeddddddg�ZdZd	d
d
d
ed
ddddd
d�
Zdd�Ze	dd
dd��Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd
d
d
d
d
d
dd �Zd!d"�Zd
S)#�Retrya�
 Retry configuration.

    Each retry attempt will create a new Retry object with updated values, so
    they can be safely reused.

    Retries can be defined as a default for a pool::

        retries = Retry(connect=5, read=2, redirect=5)
        http = PoolManager(retries=retries)
        response = http.request('GET', 'http://example.com/')

    Or per-request (which overrides the default for the pool)::

        response = http.request('GET', 'http://example.com/', retries=Retry(10))

    Retries can be disabled by passing ``False``::

        response = http.request('GET', 'http://example.com/', retries=False)

    Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless
    retries are disabled, in which case the causing exception will be raised.

    :param int total:
        Total number of retries to allow. Takes precedence over other counts.

        Set to ``None`` to remove this constraint and fall back on other
        counts. It's a good idea to set this to some sensibly-high value to
        account for unexpected edge cases and avoid infinite retry loops.

        Set to ``0`` to fail on the first retry.

        Set to ``False`` to disable and imply ``raise_on_redirect=False``.

    :param int connect:
        How many connection-related errors to retry on.

        These are errors raised before the request is sent to the remote server,
        which we assume has not triggered the server to process the request.

        Set to ``0`` to fail on the first retry of this type.

    :param int read:
        How many times to retry on read errors.

        These errors are raised after the request was sent to the server, so the
        request may have side-effects.

        Set to ``0`` to fail on the first retry of this type.

    :param int redirect:
        How many redirects to perform. Limit this to avoid infinite redirect
        loops.

        A redirect is a HTTP response with a status code 301, 302, 303, 307 or
        308.

        Set to ``0`` to fail on the first retry of this type.

        Set to ``False`` to disable and imply ``raise_on_redirect=False``.

    :param iterable method_whitelist:
        Set of uppercased HTTP method verbs that we should retry on.

        By default, we only retry on methods which are considered to be
        indempotent (multiple requests with the same parameters end with the
        same state). See :attr:`Retry.DEFAULT_METHOD_WHITELIST`.

    :param iterable status_forcelist:
        A set of HTTP status codes that we should force a retry on.

        By default, this is disabled with ``None``.

    :param float backoff_factor:
        A backoff factor to apply between attempts. urllib3 will sleep for::

            {backoff factor} * (2 ^ ({number of total retries} - 1))

        seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep
        for [0.1s, 0.2s, 0.4s, ...] between retries. It will never be longer
        than :attr:`Retry.BACKOFF_MAX`.

        By default, backoff is disabled (set to 0).

    :param bool raise_on_redirect: Whether, if the number of redirects is
        exhausted, to raise a MaxRetryError, or to return a response with a
        response code in the 3xx range.

    :param bool raise_on_status: Similar meaning to ``raise_on_redirect``:
        whether we should raise an exception, or return a response,
        if status falls in ``status_forcelist`` range and retries have
        been exhausted.
    ZHEAD�GET�PUTZDELETEZOPTIONSZTRACE�x�
NrTcCs�||_||_||_|dks3|dkr?d}d}||_|pTt�|_||_||_||_|	|_	|
|_
dS)NFr)�total�connect�read�redirect�set�status_forcelist�method_whitelist�backoff_factor�raise_on_redirect�raise_on_status�_observed_errors)�selfrrrrrrrrrr�r�	/retry.py�__init__vs								zRetry.__init__cKs�td|jd|jd|jd|jd|jd|jd|jd|jd	|j	d
|j
�
}|j|�t|�|�S)Nrrrrrrrrrr)
�dictrrrrrrrrrr�update�type)r�kwZparamsrrr�new�s						
z	Retry.newcCsu|dkr'|dk	r|n|j}t|t�r:|St|�oId}||d|�}tjd||�|S)z4 Backwards-compatibility for the old retries format.Nrz!Converted retries value: %r -> %r)�DEFAULT�
isinstancer
�bool�log�debug)�clsZretriesr�defaultZnew_retriesrrr�from_int�szRetry.from_intcCs;|jdkrdS|jd|jd}t|j|�S)zJ Formula for computing the current backoff

        :rtype: float
        �rr)rr�min�BACKOFF_MAX)rZ
backoff_valuerrr�get_backoff_time�szRetry.get_backoff_timecCs-|j�}|dkrdStj|�dS)z� Sleep between retry attempts using an exponential backoff.

        By default, the backoff factor is 0 and this method will return
        immediately.
        rN)r.�time�sleep)rZbackoffrrrr0�szRetry.sleepcCs
t|t�S)z{ Errors when we're fairly sure that the server did not receive the
        request, so it should be safe to retry.
        )r$r)r�errrrr�_is_connection_error�szRetry._is_connection_errorcCst|ttf�S)z� Errors that occur after the request has been started, so we should
        assume that the server began processing it.
        )r$rr)rr1rrr�_is_read_error�szRetry._is_read_errorcCs8|jr"|j�|jkr"dS|jo7||jkS)zR Is this method/status code retryable? (Based on method/codes whitelists)
        F)r�upperr)r�method�status_coderrr�is_forced_retry�szRetry.is_forced_retrycCsM|j|j|j|jf}ttd|��}|s=dSt|�dkS)z Are we out of retries? NFr)rrrr�list�filterr,)rZretry_countsrrr�is_exhausted�s
zRetry.is_exhaustedcCs|jdkr0|r0tjt|�||��|j}|dk	rO|d8}|j}|j}	|j}
|j}d}|r�|j|�r�|	dkr�tjt|�||��n|	dk	r�|	d8}	|d7}n�|r=|j	|�r=|
dkrtjt|�||��n|
dk	r0|
d8}
|d7}nk|rn|j
�rn|dk	re|d8}d}n:|d7}tj}|r�|j
r�tjjd|j
�}|jd|d|	d	|
d
|d|�}
|
j�r�t|||p�t|���tjd||
�|
S)
a� Return a new Retry object with incremented retry counters.

        :param response: A response object, or None, if the server did not
            return a response.
        :type response: :class:`~urllib3.response.HTTPResponse`
        :param Exception error: An error encountered during the request, or
            None if the response was received successfully.

        :return: A new ``Retry`` object.
        FNr+�unknownztoo many redirectsr6rrrrrz$Incremented Retry for (url='%s'): %r)rr	Zreraiser rrrrr2r3Zget_redirect_locationrZ
GENERIC_ERROR�statusZSPECIFIC_ERROR�formatr"r:rr&r')rr5Zurl�response�errorZ_poolZ_stacktracerrrrr�causeZ	new_retryrrr�	increment�sN	
				




	
			zRetry.incrementcCsdjdt|�d|�S)Nzf{cls.__name__}(total={self.total}, connect={self.connect}, read={self.read}, redirect={self.redirect})r(r)r=r )rrrr�__repr__s	zRetry.__repr__)�__name__�
__module__�__qualname__�__doc__�	frozensetZDEFAULT_METHOD_WHITELISTr-rr"�classmethodr*r.r0r2r3r7r:rArBrrrrr
s(\	
	Dr
�)Z
__future__rr/�logging�
exceptionsrrrrrZpackagesr	�	getLoggerrCr&�objectr
r#rrrr�<module>s(�

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 1.07 KB 0644
__init__.cpython-35.pyc File 1.07 KB 0644
connection.cpython-35.opt-1.pyc File 2.6 KB 0644
connection.cpython-35.pyc File 2.6 KB 0644
request.cpython-35.opt-1.pyc File 1.92 KB 0644
request.cpython-35.pyc File 1.92 KB 0644
response.cpython-35.opt-1.pyc File 1.8 KB 0644
response.cpython-35.pyc File 1.8 KB 0644
retry.cpython-35.opt-1.pyc File 9 KB 0644
retry.cpython-35.pyc File 9 KB 0644
ssl_.cpython-35.opt-1.pyc File 8.95 KB 0644
ssl_.cpython-35.pyc File 8.95 KB 0644
timeout.cpython-35.opt-1.pyc File 8.74 KB 0644
timeout.cpython-35.pyc File 8.74 KB 0644
url.cpython-35.opt-1.pyc File 5.08 KB 0644
url.cpython-35.pyc File 5.08 KB 0644