code: def timeout_two_stage(
          retries: int,
          timeout1: int,
          timeout2: int,
  ) -> Iterable[int]:
      
      for _ in range(retries):
          yield timeout1
      while True:
          yield timeout2
docs: Timeouts generator with a two stage strategy
  
      Timeouts start spaced by `timeout1`, after `retries` increase
      to `timeout2` which is repeated indefinitely.