code: def __init__(
      self,
      stop=None,
      wait=None,
      stop_max_attempt_number=None,
      stop_max_delay=None,
      wait_fixed=None,
      wait_random_min=None,
      wait_random_max=None,
      wait_incrementing_start=None,
      wait_incrementing_increment=None,
      wait_incrementing_max=None,
      wait_exponential_multiplier=None,
      wait_exponential_max=None,
      retry_on_exception=None,
      retry_on_result=None,
      wrap_exception=False,
      stop_func=None,
      wait_func=None,
      wait_jitter_max=None,
      before_attempts=None,
      after_attempts=None,
  ):
      self._stop_max_attempt_number = (
          5
          if stop_max_attempt_number is None
          else stop_max_attempt_number
      )
      self._stop_max_delay = (
          100 if stop_max_delay is None else stop_max_delay
      )
      self._wait_fixed = 1000 if wait_fixed is None else wait_fixed
      self._wait_random_min = (
          0 if wait_random_min is None else wait_random_min
      )
      self._wait_random_max = (
          1000 if wait_random_max is None else wait_random_max
      )
      self._wait_incrementing_start = (
          0
          if wait_incrementing_start is None
          else wait_incrementing_start
      )
      self._wait_incrementing_increment = (
          100
          if wait_incrementing_increment is None
          else wait_incrementing_increment
      )
      self._wait_exponential_multiplier = (
          1
          if wait_exponential_multiplier is None
          else wait_exponential_multiplier
      )
      self._wait_exponential_max = (
          MAX_WAIT
          if wait_exponential_max is None
          else wait_exponential_max
      )
      self._wait_incrementing_max = (
          MAX_WAIT
          if wait_incrementing_max is None
          else wait_incrementing_max
      )
      self._wait_jitter_max = (
          0 if wait_jitter_max is None else wait_jitter_max
      )
      self._before_attempts = before_attempts
      self._after_attempts = after_attempts
  
      # TODO add chaining of stop behaviors
      # stop behavior
      stop_funcs = []
      if stop_max_attempt_number is not None:
          stop_funcs.append(self.stop_after_attempt)
  
      if stop_max_delay is not None:
          stop_funcs.append(self.stop_after_delay)
  
      if stop_func is not None:
          self.stop = stop_func
  
      elif stop is None:
          self.stop = lambda attempts, delay: any(
              f(attempts, delay) for f in stop_funcs
          )
  
      else:
          self.stop = getattr(self, stop)
  
      # TODO add chaining of wait behaviors
      # wait behavior
      wait_funcs = [lambda *args, **kwargs: 0]
      if wait_fixed is not None:
          wait_funcs.append(self.fixed_sleep)
  
      if wait_random_min is not None or wait_random_max is not None:
          wait_funcs.append(self.random_sleep)
  
      if (
          wait_incrementing_start is not None
          or wait_incrementing_increment is not None
      ):
          wait_funcs.append(self.incrementing_sleep)
  
      if (
          wait_exponential_multiplier is not None
          or wait_exponential_max is not None
      ):
          wait_funcs.append(self.exponential_sleep)
  
      if wait_func is not None:
          self.wait = wait_func
  
      elif wait is None:
          self.wait = lambda attempts, delay: max(
              f(attempts, delay) for f in wait_funcs
          )
  
      else:
          self.wait = getattr(self, wait)
  
      # retry on exception filter
      if retry_on_exception is None:
          self._retry_on_exception = self.always_reject
      else:
          # this allows for providing a tuple of exception types that
          # should be allowed to retry on, and avoids having to create
          # a callback that does the same thing
          if isinstance(retry_on_exception, (tuple)):
              retry_on_exception = _retry_if_exception_of_type(
                  retry_on_exception
              )
          self._retry_on_exception = retry_on_exception
  
      # retry on result filter
      if retry_on_result is None:
          self._retry_on_result = self.never_reject
      else:
          self._retry_on_result = retry_on_result
  
      self._wrap_exception = wrap_exception
  
imports: import random
  import six
  import sys
  import time
  import traceback
label_desc: Use image node_id 1 to create a new Retrying object from inherited base classes: object with example: obj = Retrying(stop, wait, stop_max_attempt_number, stop_max_delay, wait_fixed, wait_random_min, wait_random_max, wait_incrementing_start, wait_incrementing_increment, wait_incrementing_max, wait_exponential_multiplier, wait_exponential_max, retry_on_exception, retry_on_result, wrap_exception, stop_func, wait_func, wait_jitter_max, before_attempts, after_attempts)