code: def retry(retry_count):
      
  
      def func(f):
          @functools.wraps(f)
          def wrapper(*args, **kwargs):
              for backoff in range(retry_count):
                  try:
                      return f(*args, **kwargs)
                  except Exception:
                      time.sleep(2 ** backoff)
              else:
                  raise SbgError('{}: failed to complete: {}'.format(
                      threading.current_thread().getName(), f.__name__)
                  )
  
          return wrapper
  
      return func
docs: Retry decorator used during file upload and download.