
    Pe                     :    d dl mZ  edg d      Z G d d      Zy)    )
namedtupleCubicParamsw_maxk	last_failc                   8    e Zd ZdZdZeefdZd Zd Zd Zd Z	y)	CubicCalculatorg?gffffff?c                 f    || _         || _        || _        | j                         | _        || _        y N)_w_max_scale_constant_beta_calculate_zero_point_k
_last_fail)selfstarting_max_rate
start_timescale_constantbetas        =/usr/lib/python3/dist-packages/botocore/retries/throttling.py__init__zCubicCalculator.__init__
   s1     (-
,,.$    c                 b    | j                   d| j                  z
  z  | j                  z  }|dz  }|S )N   gUUUUUU?)r   r   r   )r   scaled_valuer   s      r   r   z%CubicCalculator._calculate_zero_point   s2    q4::~6$:N:NNW%r   c                 |    || j                   z
  }| j                  || j                  z
  dz  z  | j                  z   }|S )N   )r   r   r   r   )r   	timestampdtnew_rates       r   success_receivedz CubicCalculator.success_received   s;    (''2<A*==Kr   c                 f    || _         | j                         | _        || _        || j                  z  S r   )r   r   r   r   r   )r   current_rater    s      r   error_receivedzCubicCalculator.error_received!   s1    
 #,,.#djj((r   c                 Z    t        | j                  | j                  | j                        S )aX  Return a read-only object of the current cubic parameters.

        These parameters are intended to be used for debug/troubleshooting
        purposes.  These object is a read-only snapshot and cannot be used
        to modify the behavior of the CUBIC calculations.

        New parameters may be added to this object in the future.

        r   )r   r   r   r   )r   s    r   get_params_snapshotz#CubicCalculator.get_params_snapshot+   s$     ++DOO
 	
r   N)
__name__
__module____qualname___SCALE_CONSTANT_BETAr   r   r#   r&   r(    r   r   r
   r
      s-    OE '%

)
r   r
   N)collectionsr   r   r
   r.   r   r   <module>r0      s    "(CD1
 1
r   