def truncated_exponential_backoff(<EOL>slot_delay, collision=<NUM_LIT:0>, max_collisions=<NUM_LIT:5>,<EOL>op=operator.mul, in_range=True):
truncated_collision = collision % max_collisions<EOL>if in_range:<EOL><INDENT>slots = random.randint(<NUM_LIT:0>, truncated_collision)<EOL><DEDENT>else:<EOL><INDENT>slots = truncated_collision<EOL><DEDENT>return op(slot_delay, slots)<EOL>
Truncated Exponential Backoff
    see https://en.wikipedia.org/wiki/Exponential_backoff