Skip to content

Instantly share code, notes, and snippets.

View isaiah1112's full-sized avatar

Jesse Almanrode isaiah1112

View GitHub Profile
@isaiah1112
isaiah1112 / backoff_generator.py
Created December 22, 2025 21:53
Python Examples
from typing import Optional
def backoff(start: int, stop: int, factor: Optional[int] = 5) -> int:
""" Generator for a backoff policy that increments a given start value by factor until
stop is reached.
:param start: Integer to start at
:type start: int
:param stop: Factor to increase start by
:type stop: int
:param factor: Integer to stop at or after