Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def log_it(func, trial_number, trial_time_taken):
logger.log(log_level, log_tpl,
_utils.get_callback_name(func), trial_time_taken,
_utils.to_ordinal(trial_number))
@_utils.cached_property
def wait(self):
return _compat.wait_func_accept_retry_state(self._wait)
@_utils.cached_property
def stop(self):
return _compat.stop_func_accept_retry_state(self._stop)
def after_log(retry_state):
logger.info(
"Finished call to {callback!r} after {time:.2f}, this was the {attempt} time calling it.",
callback=_utils.get_callback_name(retry_state.fn),
time=retry_state.seconds_since_start,
attempt=_utils.to_ordinal(retry_state.attempt_number),
)
def begin(self, fn):
self.statistics.clear()
self.statistics['start_time'] = _utils.now()
self.statistics['attempt_number'] = 1
self.statistics['idle_for'] = 0
self.fn = fn