Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
 mŽŒYòOã @s(dZddlmZmZmZmZmZmZmZm Z ddl m Z m Z ddl Z ddlZddlZeefZddddd d d d d ddddg ZGdd„deƒZGdd„de jƒZGdd„deƒZGdd „d e jƒZGdd„dƒZdS)z{Weak reference support for Python. This module is an implementation of PEP 205: http://www.python.org/dev/peps/pep-0205/ é)ÚgetweakrefcountÚ getweakrefsÚrefÚproxyÚCallableProxyTypeÚ ProxyTypeÚ ReferenceTypeÚ_remove_dead_weakref)ÚWeakSetÚ_IterationGuardNrrrrÚWeakKeyDictionaryrrrÚ ProxyTypesÚWeakValueDictionaryr Ú WeakMethodÚfinalizecs^eZdZdZdZddd„Z‡fd d †Zd d „Zd d„Ze j Z ‡S)rz— A custom `weakref.ref` subclass which simulates a weak reference to a bound method, working around the lifetime problem of bound methods. Ú _func_refÚ _meth_typeÚ_aliveÚ __weakref__Nc s­y|j}|j}Wn0tk rHtdjt|ƒƒƒd‚YnX‡‡fdd†}tj|||ƒ}t||ƒ|_t|ƒ|_ d|_ t|ƒ‰|S)Nz)argument should be a bound method, not {}cs5ˆƒ}|jr1d|_ˆdk r1ˆ|ƒdS)NF)r)ÚargÚself)ÚcallbackÚself_wr©ú&/opt/python35/lib/python3.5/weakref.pyÚ_cb3s     zWeakMethod.__new__.._cbT) Ú__self__Ú__func__ÚAttributeErrorÚ TypeErrorÚformatÚtyperÚ__new__rrr)ÚclsÚmethrÚobjÚfuncrrr)rrrr",s      zWeakMethod.__new__csGtƒjƒ}|jƒ}|dks3|dkr7dS|j||ƒS)N)ÚsuperÚ__call__rr)rr%r&)Ú __class__rrr(Bs  zWeakMethod.__call__cCsSt|tƒrO|j s#|j r-||kStj||ƒoN|j|jkSdS)NF)Ú isinstancerrrÚ__eq__r)rÚotherrrrr+Is  "zWeakMethod.__eq__cCsSt|tƒrO|j s#|j r-||k Stj||ƒpN|j|jkSdS)NT)r*rrrÚ__ne__r)rr,rrrr-Ps  "zWeakMethod.__ne__)rrrr) Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú __slots__r"r(r+r-rÚ__hash__rr)r)rr$s   c@seZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z e Z dd„Zddd„Zdd„Zdd„ZeZdd„Zdd „Zd!d"„Zd#d$„Zdd%d&„Zd'd(„Zd)d*„ZdS)+rz›Mapping class that references values weakly. Entries in the dictionary will be discarded when no strong reference to the value exists anymore cs£|stdƒ‚|^}}t|ƒdkrFtdt|ƒƒ‚t|ƒt‡fdd†}||_g|_tƒ|_i|_‰|j ||ŽdS)NzGdescriptor '__init__' of 'WeakValueDictionary' object needs an argumentéz$expected at most 1 arguments, got %dcsH|ƒ}|dk rD|jr4|jj|jƒn|ˆ|jƒdS)N)Ú _iteratingÚ_pending_removalsÚappendÚkey)ÚwrÚselfrefÚ_atomic_removalr)ÚdrrÚremovems    z,WeakValueDictionary.__init__..remove) rÚlenrr Ú_remover6Úsetr5ÚdataÚupdate)ÚargsÚkwrr=r)r<rÚ__init__fs      zWeakValueDictionary.__init__cCs<|j}|j}x#|r7|jƒ}t||ƒqWdS)N)r6rAÚpopr )rÚlr<r8rrrÚ_commit_removals}s     z$WeakValueDictionary._commit_removalscCsF|jr|jƒ|j|ƒ}|dkr>t|ƒ‚n|SdS)N)r6rHrAÚKeyError)rr8ÚorrrÚ __getitem__†s    zWeakValueDictionary.__getitem__cCs!|jr|jƒ|j|=dS)N)r6rHrA)rr8rrrÚ __delitem__�s  zWeakValueDictionary.__delitem__cCs |jr|jƒt|jƒS)N)r6rHr>rA)rrrrÚ__len__”s  zWeakValueDictionary.__len__c CsJ|jr|jƒy|j|ƒ}Wntk r?dSYnX|dk S)NF)r6rHrArI)rr8rJrrrÚ __contains__™s    z WeakValueDictionary.__contains__cCsd|jjt|ƒfS)Nz <%s at %#x>)r)r.Úid)rrrrÚ__repr__¢szWeakValueDictionary.__repr__cCs3|jr|jƒt||j|ƒ|j|r6rHrAÚhasattrr!rTrQr?rB)rCÚkwargsrÚdictr<r8rJrrrrB s        zWeakValueDictionary.updatecCs&|jr|jƒt|jjƒƒS)a~Return a list of weak references to the values. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the values around longer than needed. )r6rHÚlistrAr_)rrrrÚ valuerefs3s  zWeakValueDictionary.valuerefs)r.r/r0r1rErHrKrLrMrNrPrSrVÚ__copy__rYr[rTr^Ú__iter__r`r_rarFrbrBrgrrrrrZs.            cs:eZdZdZdZdd„Z‡fdd†Z‡S)rQa[Specialized reference that includes a key corresponding to the value. This is used in the WeakValueDictionary to avoid having to create a function object for each key stored in the mapping. A shared callback object can use the 'key' attribute of a KeyedRef instead of getting a reference to the key from an enclosing scope. r8cCs"tj|||ƒ}||_|S)N)rr"r8)r!Úobrr8rrrrr"Ns zKeyedRef.__new__cstƒj||ƒdS)N)r'rE)rrjrr8)r)rrrESszKeyedRef.__init__)r8)r.r/r0r1r2r"rErr)r)rrQBs  rQc@seZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z e Z dd„Zddd„Zdd„Zdd„Zdd„ZeZdd „Zd!d"„Zd#d$„Zd%d&„Zdd'd(„Zdd)d*„ZdS)+r a‰ Mapping class that references keys weakly. Entries in the dictionary will be discarded when there is no longer a strong reference to the key. This can be used to associate additional data with an object owned by other parts of an application without adding attributes to those objects. This can be especially useful with objects that override attribute accesses. NcCsbi|_t|ƒdd„}||_g|_tƒ|_d|_|dk r^|j|ƒdS)NcSs?|ƒ}|dk r;|jr1|jj|ƒn |j|=dS)N)r5r6r7rA)r\r:rrrrr=ds    z*WeakKeyDictionary.__init__..removeF)rArr?r6r@r5Ú _dirty_lenrB)rrer=rrrrEbs      zWeakKeyDictionary.__init__c CsI|j}|j}x0|rDy||jƒ=Wqtk r@YqXqWdS)N)r6rArFrI)rrGr<rrrrHss    z"WeakKeyDictionary._commit_removalscs5|j‰‡fdd†|jDƒ|_d|_dS)Ncs"g|]}|ˆkr|‘qSrr)Ú.0r\)r<rrú ‚s z5WeakKeyDictionary._scrub_removals..F)rAr6rk)rr)r<rÚ_scrub_removals€s z!WeakKeyDictionary._scrub_removalscCsd|_|jt|ƒ=dS)NT)rkrAr)rr8rrrrL…s zWeakKeyDictionary.__delitem__cCs|jt|ƒS)N)rAr)rr8rrrrK‰szWeakKeyDictionary.__getitem__cCs6|jr|jr|jƒt|jƒt|jƒS)N)rkr6rnr>rA)rrrrrMŒs zWeakKeyDictionary.__len__cCsd|jjt|ƒfS)Nz <%s at %#x>)r)r.rO)rrrrrP“szWeakKeyDictionary.__repr__cCs||jt||jƒrB)rrerdr<r8rRrrrrBçs   zWeakKeyDictionary.update)r.r/r0r1rErHrnrLrKrMrPrSrVrhrYr[rNrTr^rir_rorarFrbrBrrrrr Ws.               c@sïeZdZdZfZiZdZejƒZ dZ dZ Gdd„dƒZ dd„Z ddd „Zd d „Zd d „Zedd„ƒZedd„ƒZejdd„ƒZdd„Zedd„ƒZedd„ƒZdS)raClass for finalization of weakrefable objects finalize(obj, func, *args, **kwargs) returns a callable finalizer object which will be called when obj is garbage collected. The first time the finalizer is called it evaluates func(*arg, **kwargs) and returns the result. After this the finalizer is dead, and calling it just returns None. When the program exits any remaining finalizers for which the atexit attribute is true will be run in reverse order of creation. By default atexit is true. Fc@seZdZdZdS) zfinalize._InfoÚweakrefr&rCrdÚatexitÚindexN)rpr&rCrdrqrr)r.r/r0r2rrrrÚ_Info s rscOs¢|js.ddl}|j|jƒdt_|jƒ}t||ƒ|_||_||_ |pgd|_ d|_t |j ƒ|_ ||j|z!<%s object at %#x; for %r at %#x>)ryr[rpr!r.rO)rr{r%rrrrPGs  zfinalize.__repr__cCsCdd„|jjƒDƒ}|jddd„ƒdd„|DƒS)NcSs+g|]!\}}|jr||f‘qSr)rq)rlÚfÚirrrrmSs z-finalize._select_for_exit..r8cSs |djS)Nr4)rr)ÚitemrrrÚTsz+finalize._select_for_exit..cSsg|]\}}|‘qSrr)rlr‚rƒrrrrmUs )ryrTÚsort)r#ÚLrrrÚ_select_for_exitPszfinalize._select_for_exitcCsîd}zÇ|jrÌddl}|jƒr:d}|jƒd}x‰|dksXtjrm|jƒ}dt_|stP|jƒ}y |ƒWn%tk r²t j t j ƒŒYnX||jksCt ‚qCWWddt_ |ré|jƒXdS)NFrT)ryÚgcÚ isenabledÚdisablerrzrˆrFÚ ExceptionÚsysÚ excepthookÚexc_infoÚAssertionErrorr|Úenable)r#Ú reenable_gcr‰Úpendingr‚rrrrvWs.          zfinalize._exitfunc)r.r/r0r1r2ryr|Ú itertoolsÚcountrxrzrtrsrEr(r~rÚpropertyr€rqÚsetterrPÚ classmethodrˆrvrrrrròs$      )r1Ú_weakrefrrrrrrrr Ú _weakrefsetr r Ú collectionsr�r”r Ú__all__rÚMutableMappingrrQr rrrrrÚs:        6è›