@@ -24,8 +24,7 @@ def my_method():
2424
2525 with decorators.print_runtime("My Code Block"):
2626 # code ...
27- # code ...
28- """
27+ # code ... """
2928 if not description :
3029 description = "Code Block"
3130 description = str (description )
@@ -68,8 +67,7 @@ def my_method():
6867
6968@contextmanager
7069def runtime_limit (limit , description = None ):
71- """
72- Fail if the runtime duration of a method or "with"-block exceeds the limit.
70+ """Fail if the runtime duration of a method or "with"-block exceeds limit.
7371 (The failure won't occur until after the method or "with"-block completes.)
7472
7573 Method / Function example usage ->
@@ -85,8 +83,7 @@ def my_method():
8583
8684 with decorators.runtime_limit(32):
8785 # code ...
88- # code ...
89- """
86+ # code ... """
9087 limit = float ("%.2f" % limit )
9188 if limit < 0.01 :
9289 limit = 0.01 # Minimum runtime limit
@@ -115,14 +112,12 @@ def my_method():
115112
116113
117114def retry_on_exception (tries = 6 , delay = 1 , backoff = 2 , max_delay = 32 ):
118- """
119- Decorator for implementing exponential backoff for retrying on failures.
115+ """Decorator for implementing exponential backoff for retrying on failures.
120116
121117 tries: Max number of tries to execute the wrapped function before failing.
122118 delay: Delay time in seconds before the FIRST retry.
123119 backoff: Multiplier to extend the initial delay by for each retry.
124- max_delay: Max time in seconds to wait between retries.
125- """
120+ max_delay: Max time in seconds to wait between retries."""
126121 tries = math .floor (tries )
127122 if tries < 1 :
128123 raise ValueError ('"tries" must be greater than or equal to 1.' )
0 commit comments