Module Expr Str ImportFrom alias alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias alias Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore BinOpAdd Num BinOpDiv Call AttributeLoad NameLoad attr Num For NameStore Call NameLoad Call NameLoad BinOpFloorDiv AttributeLoad NameLoad attr NameLoad body If CompareNotEq NameLoad Num body Expr Call NameLoad NameLoad Assign NameStore Call NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Break If AttributeLoad NameLoad attr body Break Return CompareIsNot AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad TryFinally body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr NameLoad finalbody Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Return Num Assign NameStore BinOpSub Call NameLoad AttributeLoad NameLoad attr Return Call NameLoad BinOpSub AttributeLoad NameLoad attr NameLoad Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad BinOpSub Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Return NameLoad Assign TupleStore NameStore NameStore TupleLoad Call NameLoad NameLoad AttributeLoad NameLoad attr If CompareNotIn NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Return TupleLoad NameLoad Call NameLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body ImportFrom alias Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot Call NameLoad NameLoad Str body Assign NameStore AttributeStore NameLoad attr Dict orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotIn NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Return SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A 
sentry.utils.cache
~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
 __future__ absolute_import print_function N/A functools N/A logging N/A random django.core.cache cache time sleep time N/A default_cache cache N/A logger N/A N/A logging getLogger __name__ UnableToGetLock N/A Exception N/A N/A N/A LockAlreadyHeld N/A UnableToGetLock N/A N/A N/A Lock N/A object N/A N/A 
    Uses the defined cache backend to create a lock.

    >>> with Lock('key name'):
    >>>     # do something
     __init__ N/A N/A self lock_key timeout cache nowait N/A 3 None False N/A N/A N/A cache None N/A N/A N/A self cache default_cache N/A N/A N/A self cache cache N/A N/A self timeout timeout N/A N/A self lock_key lock_key N/A N/A self nowait nowait N/A N/A self __acquired_at None N/A __repr__ N/A N/A self N/A N/A N/A N/A <Lock: %r> N/A N/A self lock_key N/A acquire N/A N/A self N/A N/A N/A 
        Attempt to acquire the lock, returning a boolean that represents if the
        lock is held.
         N/A time_remaining N/A self seconds_remaining N/A time_remaining N/A N/A N/A LockAlreadyHeld N/A Tried to acquire lock that is already held, %.3fs remaining: %r N/A time_remaining self N/A N/A self __acquired_at None N/A delay N/A 0.01 N/A N/A N/A random random 10 N/A i N/A xrange N/A int N/A N/A self timeout delay N/A N/A N/A i 0 N/A N/A N/A sleep delay N/A attempt_started_at N/A time N/A N/A N/A N/A self cache add N/A self lock_key N/A self timeout N/A N/A N/A self __acquired_at attempt_started_at N/A N/A N/A self nowait N/A N/A N/A N/A N/A self __acquired_at None N/A release N/A N/A self N/A N/A N/A 
        Release the lock.
         N/A N/A N/A self held N/A N/A N/A N/A logger warning Tried to release unheld lock: %r self N/A False N/A N/A N/A N/A N/A N/A N/A N/A self cache delete N/A self lock_key N/A N/A N/A Exception N/A e N/A N/A N/A N/A logger exception e N/A N/A N/A self __acquired_at None N/A True N/A seconds_remaining N/A N/A self N/A N/A N/A N/A N/A self __acquired_at None N/A N/A 0 N/A lifespan N/A N/A time N/A self __acquired_at N/A N/A max N/A N/A self timeout lifespan 0 N/A property held N/A N/A self N/A N/A N/A N/A bool N/A self seconds_remaining N/A property __enter__ N/A N/A self N/A N/A N/A start N/A time N/A N/A N/A N/A self acquire N/A N/A N/A UnableToGetLock N/A Unable to fetch lock after %.3fs: %r N/A N/A N/A time start self N/A self N/A __exit__ N/A N/A self exc_type exc_value traceback N/A N/A N/A N/A N/A self release N/A N/A memoize N/A object N/A N/A 
    Memoize the result of a property call.

    >>> class A(object):
    >>>     @memoize
    >>>     def func(self):
    >>>         return 'foo'
     __init__ N/A N/A self func N/A N/A N/A N/A self __name__ N/A func __name__ N/A N/A self __module__ N/A func __module__ N/A N/A self __doc__ N/A func __doc__ N/A N/A self func func N/A __get__ N/A N/A self obj type N/A None N/A N/A N/A obj None N/A N/A self N/A N/A d n N/A N/A vars obj N/A self __name__ N/A N/A n d N/A N/A value N/A N/A self func obj N/A N/A d N/A n value N/A value N/A d N/A n N/A value N/A N/A cached_for_request N/A memoize N/A N/A 
    Memoize the result of a for the duration of a request. If the system does
    not think it's in a request, the result is never saved.

    >>> class A(object):
    >>>     @memoize_for_request
    >>>     def func(self):
    >>>         return 'foo'
     _get_key N/A N/A self args kwargs N/A N/A N/A N/A self N/A tuple args N/A tuple N/A N/A kwargs items N/A __call__ N/A N/A self N/A args kwargs N/A sentry.app env N/A request N/A env request N/A N/A request N/A N/A N/A N/A self func args kwargs N/A N/A N/A hasattr request __func_cache N/A N/A data N/A request __func_cache N/A N/A N/A data N/A request __func_cache N/A key N/A N/A self _get_key args kwargs N/A N/A key data N/A N/A value N/A N/A self func args kwargs N/A N/A data N/A key value N/A N/A data N/A key N/A __get__ N/A N/A self obj type N/A None N/A N/A N/A N/A functools partial N/A self __call__ obj N/A N/A