MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / wrap

Function wrap

tensorflow/contrib/learn/python/learn/datasets/base.py:198–216  ·  view source on GitHub ↗

Wrapper function factory invoked by decorator magic.

(fn)

Source from the content-addressed store, hash-verified

196 delay *= factor
197
198 def wrap(fn):
199 """Wrapper function factory invoked by decorator magic."""
200
201 def wrapped_fn(*args, **kwargs):
202 """The actual wrapper function that applies the retry logic."""
203 for delay in delays():
204 try:
205 return fn(*args, **kwargs)
206 except Exception as e: # pylint: disable=broad-except
207 if is_retriable is None:
208 continue
209
210 if is_retriable(e):
211 time.sleep(delay)
212 else:
213 raise
214 return fn(*args, **kwargs)
215
216 return wrapped_fn
217
218 return wrap
219

Callers 1

OpLevelCostEstimatorMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected