Module ImportFrom alias identifier Import alias Assign NameStore BinOpDiv Num Num Assign NameStore Num Assign NameStore NameLoad FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Num If Call AttributeLoad NameLoad attr Str body Delete SubscriptDel NameLoad Index Str While NameLoad body TryExcept body Return Call NameLoad NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call NameLoad NameLoad AugAssignMult NameStore Num If CompareGt NameLoad NameLoad body Assign NameStore NameLoad AugAssignSub NameStore Num If CompareEq NameLoad Num body Raise decorator_list
N/A time sleep _sleep N/A db N/A _deadlock_MinSleepTime N/A 1.0 128 N/A _deadlock_MaxSleepTime 3.14159 N/A _deadlock_VerboseFile None DeadlockWrap N/A N/A function N/A _args _kwargs N/A N/A DeadlockWrap(function, *_args, **_kwargs) - automatically retries
    function in case of a database deadlock.

    This is a function intended to be used to wrap database calls such
    that they perform retrys with exponentially backing off sleeps in
    between when a DBLockDeadlockError exception is raised.

    A 'max_retries' parameter may optionally be passed to prevent it
    from retrying forever (in which case the exception will be reraised).

        d = DB(...)
        d.open(...)
        DeadlockWrap(d.put, "foo", data="bar")  # set key "foo" to "bar"
     N/A sleeptime _deadlock_MinSleepTime N/A max_retries N/A N/A _kwargs get max_retries -1 N/A N/A N/A _kwargs has_key max_retries N/A N/A N/A _kwargs N/A max_retries N/A True N/A N/A N/A N/A N/A function _args _kwargs N/A N/A N/A N/A db DBLockDeadlockError N/A N/A _deadlock_VerboseFile N/A N/A N/A N/A _deadlock_VerboseFile write N/A dbutils.DeadlockWrap: sleeping %1.3f
 sleeptime N/A N/A _sleep sleeptime N/A sleeptime 2 N/A N/A sleeptime _deadlock_MaxSleepTime N/A N/A sleeptime _deadlock_MaxSleepTime N/A max_retries 1 N/A N/A max_retries -1 N/A N/A N/A