File: //proc/722141/root/lib/python3.6/site-packages/botocore/__pycache__/retryhandler.cpython-36.pyc
3
�T_�5 � @ s$ d dl Z d dlZd dlZd dlmZ d dlmZmZmZm Z m
Z
eje�Z
de e
eegiZdd� Zdd� Zd%d d
�Zd&dd�Zd'd
d�Zdd� Zdd� Zdd� ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�ZG d#d$� d$e�ZdS )(� N)�crc32)�
ChecksumError�EndpointConnectionError�ReadTimeoutError�ConnectionError�ConnectionClosedErrorZGENERAL_CONNECTION_ERRORc C s: | dkrt j � } n| dkr&td| ��| ||d }|S )a1 Calculate time to sleep based on exponential function.
The format is::
base * growth_factor ^ (attempts - 1)
If ``base`` is set to 'rand' then a random number between
0 and 1 will be used as the base.
Base must be greater than 0, otherwise a ValueError will be
raised.
Zrandr z0The 'base' param must be greater than 0, got: %s� )�random�
ValueError)�base�
growth_factor�attemptsZ
time_to_sleep� r �"/usr/lib/python3.6/retryhandler.py�delay_exponential'