/usr/local/lib/python3.6/site-packages/urllib3/util/__pycache__
NameSizeModeActions
connection.cpython-36.pyc33650644editdlrm
proxy.cpython-36.pyc12730644editdlrm
queue.cpython-36.pyc9900644editdlrm
request.cpython-36.pyc34550644editdlrm
response.cpython-36.pyc22770644editdlrm
retry.cpython-36.pyc168620644editdlrm
ssltransport.cpython-36.pyc72570644editdlrm
ssl_.cpython-36.pyc115300644editdlrm
ssl_match_hostname.cpython-36.pyc31970644editdlrm
timeout.cpython-36.pyc90530644editdlrm
url.cpython-36.pyc106370644editdlrm
wait.cpython-36.pyc30980644editdlrm
__init__.cpython-36.pyc12250644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/urllib3/util/__pycache__/retry.cpython-36.pyc (16862B)
3 Eg"V@sddlmZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z m Z mZmZmZmZmZddlmZejeZedd d d d d gZeZGdddeZejeGdddeZede_dS))absolute_importN) namedtuple) takewhile)ConnectTimeoutError InvalidHeader MaxRetryError ProtocolError ProxyErrorReadTimeoutError ResponseError)sixRequestHistorymethodurlerrorstatusredirect_locationc@sZeZdZeddZejddZeddZejddZeddZejd dZd S) _RetryMetacCstjdt|jS)Nz}Using 'Retry.DEFAULT_METHOD_WHITELIST' is deprecated and will be removed in v2.0. Use 'Retry.DEFAULT_ALLOWED_METHODS' instead)warningswarnDeprecationWarningDEFAULT_ALLOWED_METHODS)clsr/sz"Retry.__init__..)_Default ValueErrorrrrrrtotalconnectreadrotherredirectsetstatus_forcelistallowed_methodsbackoff_factorraise_on_redirectraise_on_statustuplehistoryrespect_retry_after_header frozensetremove_headers_on_redirect)selfr9r:r;r=rr<r@r?rArBrCrErFrHmethod_whitelistrrr__init__s>  zRetry.__init__cKst|j|j|j|j|j|j|j|j|j |j |j |j |j d }d|krxd|krxd|jkrntjdt|j|d<n |j|d<|j|t|f|S)N) r9r:r;r=rr<r?rArBrCrErHrFrJr@zlUsing 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead)dictr9r:r;r=rr<r?rArBrCrErHrF__dict__rrrr@updatetype)rIkwparamsrrrnew2s.     z Retry.newcCsR|dkr|dk r|n|j}t|tr(|St|o2d}|||d}tjd|||S)z3Backwards-compatibility for the old retries format.N)r=z!Converted retries value: %r -> %r)DEFAULT isinstancer'boollogdebug)rretriesr=default new_retriesrrrfrom_intVs   zRetry.from_intcCsFtttddt|j}|dkr(dS|jd|d}t|j|S)zIFormula for computing the current backoff :rtype: float cSs |jdkS)N)r)xrrrlsz(Retry.get_backoff_time..rr)lenlistrreversedrErAminr )rIconsecutive_errors_len backoff_valuerrrget_backoff_timedszRetry.get_backoff_timecCstjd|rt|}n`tjj|}|dkr6td||ddkr^|ddd|dd}tjj|}|tj}|dkrd}|S)Nz^\s*[0-9]+\s*$zInvalid Retry-After header: %s rr1)r) rematchintemailutils parsedate_tzr mktime_tztime)rI retry_aftersecondsretry_date_tuple retry_daterrrparse_retry_afterus       zRetry.parse_retry_aftercCs"|jjd}|dkrdS|j|S)z(Get the value of Retry-After in seconds.z Retry-AfterN)headersgetrs)rIresponserorrrget_retry_afters zRetry.get_retry_aftercCs |j|}|rtj|dSdS)NTF)rwrnsleep)rIrvrorrrsleep_for_retrys   zRetry.sleep_for_retrycCs"|j}|dkrdStj|dS)Nr)rernrx)rIbackoffrrr_sleep_backoffszRetry._sleep_backoffcCs(|jr|r|j|}|rdS|jdS)aBSleep between retry attempts. This method will respect a server's ``Retry-After`` response header and sleep the duration of the time requested. If that is not present, it will use an exponential backoff. By default, the backoff factor is 0 and this method will return immediately. N)rFryr{)rIrvsleptrrrrxs  z Retry.sleepcCst|tr|j}t|tS)zzErrors when we're fairly sure that the server did not receive the request, so it should be safe to retry. )rTr original_errorr)rIerrrrr_is_connection_errors zRetry._is_connection_errorcCst|ttfS)zErrors that occur after the request has been started, so we should assume that the server began processing it. )rTr r )rIr~rrr_is_read_errorszRetry._is_read_errorcCs<d|jkrtjdt|j}n|j}|r8|j|kr8dSdS)zyChecks if a given HTTP method should be retried upon, depending if it is included in the allowed_methods rJzlUsing 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' insteadFT)rMrrrrJr@upper)rIrr@rrr_is_method_retryables zRetry._is_method_retryableFcCs<|j|sdS|jr"||jkr"dS|jo:|jo:|o:||jkS)awIs this method/status code retryable? (Based on allowlists and control variables such as the number of total retries to allow, whether to respect the Retry-After header, whether this header is present, and whether the returned status code is on the list of status codes to be retried upon on the presence of the aforementioned header) FT)rr?r9rFRETRY_AFTER_STATUS_CODES)rIr status_codehas_retry_afterrrris_retrys zRetry.is_retrycCs>|j|j|j|j|j|jf}ttd|}|s2dSt|dkS)zAre we out of retries?NFr) r9r:r;r=rr<r`filterrb)rI retry_countsrrr is_exhaustedszRetry.is_exhaustedc Cs|jdkr |r tjt||||j}|dk r6|d8}|j}|j} |j} |j} |j} d} d}d}|r|j |r|dkrtjt|||n|dk r|d8}n|r|j |r| dks|j | rtjt|||n| dk r| d8} n|r| dk r| d8} nr|r0|j r0| dk r| d8} d} |j }|j}ns*   $  8