Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / functools32 / functools32.pyc
Size: Mime:
ó
ʓEYc	@s>dZddddddddd	g	Zd
dlmZmZd
dlmZmZd
dlm	Z
d
dlmZ
d
dlZyd
dlmZWn!ek
r¶d
dlmZnXdefd„ƒYZdefd„ƒYZd"Zd#Zeed„Zeed„Zd„Zd„ZeddƒZd d!„Z dS($sEfunctools.py - Tools for working with functions and callable objects
tupdate_wrappertwrapstWRAPPER_ASSIGNMENTStWRAPPER_UPDATESttotal_orderingt
cmp_to_keyt	lru_cachetreducetpartialiÿÿÿÿ(RR(tMutableMappingt
namedtuplei(trecursive_repr(tproxyN(t
allocate_lockt_LinkcBseZdZRS(tprevtnexttkeyt__weakref__(sprevsnextskeys__weakref__(t__name__t
__module__t	__slots__(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRstOrderedDictcBseZdZd„Zejeed„Zejd„Zd„Z	d„Z
d„Zed„Z
ed„Zd	„ZejZZejZejZejZejZeƒZed
„Zdd„Zeƒd„ƒZd
„Zd„Ze dd„ƒZ!d„Z"RS(s)Dictionary that remembers insertion ordercOs™t|ƒdkr+tdt|ƒƒ‚ny|jWnLtk
r„tƒ|_t|jƒ|_}||_|_i|_	nX|j
||ŽdS(sÅInitialize an ordered dictionary.  The signature is the same as
        regular dictionaries, but keyword arguments are not recommended because
        their insertion order is arbitrary.

        is$expected at most 1 arguments, got %dN(tlent	TypeErrort_OrderedDict__roottAttributeErrorRt_OrderedDict__hardroott_proxyRRt_OrderedDict__mapt_OrderedDict__update(tselftargstkwdstroot((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt__init__.s

c	Cs~||krj|ƒ|j|<}|j}|j}||||_|_|_||_||ƒ|_n||||ƒdS(s!od.__setitem__(i, y) <==> od[i]=yN(RRRRR(	RRtvaluetdict_setitemRtLinktlinkR"tlast((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt__setitem__?s			cCsG|||ƒ|jj|ƒ}|j}|j}||_||_dS(s od.__delitem__(y) <==> del od[y]N(RtpopRR(RRtdict_delitemR't	link_prevt	link_next((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt__delitem__Ms
			ccs:|j}|j}x!||k	r5|jV|j}qWdS(sod.__iter__() <==> iter(od)N(RRR(RR"tcurr((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt__iter__Xs
		ccs:|j}|j}x!||k	r5|jV|j}qWdS(s#od.__reversed__() <==> reversed(od)N(RRR(RR"R/((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt__reversed__as
		cCs7|j}||_|_|jjƒtj|ƒdS(s.od.clear() -> None.  Remove all items from od.N(RRRRtcleartdict(RR"((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyR2js	
cCsž|stdƒ‚n|j}|rK|j}|j}||_||_n$|j}|j}||_||_|j}|j|=tj||ƒ}||fS(s™od.popitem() -> (k, v), return and remove a (key, value) pair.
        Pairs are returned in LIFO order if last is true or FIFO order if false.

        sdictionary is empty(tKeyErrorRRRRRR3R*(RR(R"R'R,R-RR$((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pytpopitemqs 									
cCs|j|}|j}|j}||_||_|j}|rn|j}||_||_||_|_n+|j}||_||_||_|_dS(sÑMove an existing element to the end (or beginning if last==False).

        Raises KeyError if the element does not exist.
        When last=True, acts like a fast version of self[key]=self.pop(key).

        N(RRRR(RRR(R'R,R-R"tfirst((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pytmove_to_endˆs
											cCsqtj}t|ƒd}||jƒ}|||jƒd7}|||jƒ|7}|||jƒ|7}|S(Nii(t_syst	getsizeofRt__dict__RRR(Rtsizeoftntsize((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt
__sizeof__ s	cCsC||kr!||}||=|S||jkr?t|ƒ‚n|S(s²od.pop(k[,d]) -> v, remove specified key and return the corresponding
        value.  If key is not found, d is returned if given, otherwise KeyError
        is raised.

        (t_OrderedDict__markerR4(RRtdefaulttresult((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyR*±s
cCs"||kr||S|||<|S(sDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od((RRR@((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt
setdefault¿s
cCs7|sd|jjfSd|jjt|jƒƒfS(sod.__repr__() <==> repr(od)s%s()s%s(%r)(t	__class__Rtlisttitems(R((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt__repr__ÆscCsˆg|D]}|||g^q}t|ƒjƒ}x'ttƒƒD]}|j|dƒqEW|rx|j|f|fS|j|ffS(s%Return state information for picklingN(tvarstcopyRR*tNoneRC(RtkREt	inst_dict((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt
__reduce__Ís#cCs
|j|ƒS(s!od.copy() -> a shallow copy of od(RC(R((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRH×scCs(|ƒ}x|D]}|||<qW|S(sOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
        If not specified, the value defaults to None.

        ((tclstiterableR$RR((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pytfromkeysÛs	
cCs`t|tƒrPt|ƒt|ƒkoOtd„t|jƒ|jƒƒDƒƒStj||ƒS(s“od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
        while comparison to a regular mapping is order-insensitive.

        css!|]\}}||kVqdS(N((t.0tptq((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pys	<genexpr>ís(t
isinstanceRRtalltzipRER3t__eq__(Rtother((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRVæs)N(#RRt__doc__R#R3R)RRR.R0R1R2tTrueR5R7R>R	tupdateRtkeystvaluesREt__ne__tobjectR?R*RIRBt_recursive_reprRFRLRHtclassmethodRORV(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRs0	
							
						
	
RRRXR:cCsˆ||_xE|D]=}yt||ƒ}Wntk
r<qXt|||ƒqWx0|D](}t||ƒjt||iƒƒqXW|S(sUpdate a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    (t__wrapped__tgetattrRtsetattrRZ(twrappertwrappedtassignedtupdatedtattrR$((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRõs	


&cCsttd|d|d|ƒS(s‹Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    ReRfRg(RR(ReRfRg((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRscCsKidd„fdd„fdd„fgd6dd„fdd	„fdd
„fgd6dd„fdd„fdd
„fgd6dd„fdd„fdd„fgd6}tt|ƒƒt|ƒ@}|sãtdƒ‚nt|ƒ}xU||D]I\}}||krú||_tt|ƒj|_t|||ƒqúqúW|S(s6Class decorator that fills in missing ordering methodst__gt__cSs||kp||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt<lambda>"st__le__cSs||kp||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj#st__ge__cSs||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj$st__lt__cSs||kp||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj%scSs||ko||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj&scSs||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj'scSs||kp||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj(scSs||kp||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj)scSs||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj*scSs||kp||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj+scSs||ko||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj,scSs||kS(N((RRW((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRj-ss6must define at least one ordering operation: < > <= >=(	tsettdirt
ValueErrortmaxRRbtintRXRc(RMtconverttrootsR"topnametopfunc((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRs.	cs dtf‡fd†ƒY}|S(s,Convert a cmp= function into a key= functiontKcszeZdgZd„Z‡fd†Z‡fd†Z‡fd†Z‡fd†Z‡fd†Z‡fd†Z	dZRS(	tobjcSs
||_dS(N(Rx(RRx((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyR#>scsˆ|j|jƒdkS(Ni(Rx(RRW(tmycmp(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRm@scsˆ|j|jƒdkS(Ni(Rx(RRW(Ry(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRiBscsˆ|j|jƒdkS(Ni(Rx(RRW(Ry(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRVDscsˆ|j|jƒdkS(Ni(Rx(RRW(Ry(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRkFscsˆ|j|jƒdkS(Ni(Rx(RRW(Ry(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRlHscsˆ|j|jƒdkS(Ni(Rx(RRW(Ry(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyR]JsN(RRRR#RmRiRVRkRlR]RIt__hash__((Ry(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRw<s		(R^(RyRw((RysL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyR:st	CacheInfoshits misses maxsize currsizeidcstttt‡fd†}|S(sìLeast-recently-used cache decorator.

    If *maxsize* is set to None, the LRU features are disabled and the cache
    can grow without bound.

    Arguments to the cached function must be hashable.

    View the cache statistics named tuple (hits, misses, maxsize, currsize) with
    f.cache_info().  Clear the cache and statistics with f.cache_clear().
    Access the underlying function with f.__wrapped__.

    See:  http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used

    csdgdg‰‰tƒf‰tƒ‰ˆdkrptƒ‰tˆƒ‡‡‡‡‡‡	‡
‡fd†ƒ}nZtƒ‰ˆj‰ˆj‰tˆƒ‡‡‡‡‡‡‡‡‡‡‡	‡
‡f
d†ƒ}‡‡‡‡‡‡fd†}‡‡‡‡fd†}||_||_	|S(Nics’|}|r/|ˆˆˆ|jƒƒƒ7}ny"ˆ|}ˆdcd7<|SWnˆk
rdnXˆ||Ž}|ˆ|<ˆdcd7<|S(Nii(RE(R R!RRA(R4tcachethitstkwd_marktmissestsortedttuplet
user_function(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRdos#


c	sÕ|}|r/|ˆˆˆ
|jƒƒƒ7}nˆEy,ˆ|}ˆ|ƒˆdcd7<|SWnˆk
runXWdQXˆ||Ž}ˆ>|ˆ|<ˆ	dcd7<ˆˆƒˆkrˈdƒnWdQX|S(Nii(RE(R R!RRA(
R4R|t
cache_popitemtcache_renewR}R~RtlocktmaxsizeRR€RR‚(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRdƒs$#




c
s2ˆ&tˆdˆdˆˆˆƒƒSWdQXdS(sReport cache statisticsiN(t
_CacheInfo((R|R}RR…R†R(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt
cache_info˜scs-ˆ!ˆjƒdˆd<ˆd<WdQXdS(s$Clear the cache and cache statisticsiN(R2((R|R}R…R(sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pytcache_clears
(
R^tLockRIR3RRR5R7RˆR‰(R‚RR€RR4RdRˆR‰(R†(R4R|RƒR„R}R~RR…RR€RR‚sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pytdecorating_functiones		3			?		(RR€RR4(R†R‹((R†sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyRQsA(s
__module__s__name__s__doc__(s__dict__(!RXt__all__t
_functoolsRRtcollectionsR	R
t	reprlib32RR_tweakrefRRtsysR8tthreadR
RŠtImportErrort_dummy_thread32R^RR3RRRRRRRR‡R(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/functools32/functools32.pyt<module>s.	
Ô