PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  lY=@s`ddlmZmZddlmZddlZddlZddlZddl Z ddl Tddl m Z m Z ddZ Gdd d ZGd d d Zd d ZeGdddZeGdddeZddZGdddZGdddeZddZGdddZGdddZddZdS) )SequenceIterable)total_orderingN)*)_get_object_traceback _get_tracescCsxd D]}t|dkrM|dkrM|r?d||fSd||fSt|dksk|dkr|rd ||fSd ||fS|d }qWdS)NBKiBMiBGiBTiBdz%+.1f %sz%.1f %s iz%+.0f %sz%.0f %s)rr r r r i()abs)sizesignZunitr*/opt/python35/lib/python3.5/tracemalloc.py _format_size s rc@sdeZdZdZdZddZddZd d Zd d Zd dZ ddZ dS) StatisticzS Statistic difference on memory allocations between two Snapshot instance. tracebackrcountcCs||_||_||_dS)N)rrr)selfrrrrrr__init__%s  zStatistic.__init__cCst|j|j|jfS)N)hashrrr)rrrr__hash__*szStatistic.__hash__cCs4|j|jko3|j|jko3|j|jkS)N)rrr)rotherrrr__eq__-szStatistic.__eq__cCsYd|jt|jd|jf}|jrU|j|j}|dt|d7}|S)Nz%s: size=%s, count=%iFz , average=%s)rrrr)rtextaveragerrr__str__2s  zStatistic.__str__cCsd|j|j|jfS)Nz))rrr)rrrr__repr__<szStatistic.__repr__cCs|j|j|jfS)N)rrr)rrrr _sort_key@szStatistic._sort_keyN)rrr) __name__ __module__ __qualname____doc__ __slots__rrrr r!r"rrrrrs     rc@sdeZdZdZdZddZd d Zd d Zd dZddZ ddZ dS) StatisticDiffzd Statistic difference on memory allocations between an old and a new Snapshot instance. rr size_diffr count_diffcCs1||_||_||_||_||_dS)N)rrr)rr*)rrrr)rr*rrrrKs     zStatisticDiff.__init__cCs(t|j|j|j|j|jfS)N)rrrr)rr*)rrrrrRszStatisticDiff.__hash__cCsX|j|jkoW|j|jkoW|j|jkoW|j|jkoW|j|jkS)N)rrr)rr*)rrrrrrVs zStatisticDiff.__eq__cCsnd|jt|jdt|jd|j|jf}|jrj|j|j}|dt|d7}|S)Nz %s: size=%s (%s), count=%i (%+i)FTz , average=%s)rrrr)rr*)rrrrrrr ]s  zStatisticDiff.__str__cCs&d|j|j|j|j|jfS)Nz9)rrr)rr*)rrrrr!iszStatisticDiff.__repr__cCs.t|j|jt|j|j|jfS)N)rr)rr*rr)rrrrr"nszStatisticDiff._sort_keyN)rrr)rr*) r#r$r%r&r'rrrr r!r"rrrrr(Ds     r(cCsg}x|jD]\}}|j|d}|dk rrt||j|j|j|j|j|j}n$t||j|j|j|j}|j|qWxG|jD]9\}}t|d|j d|j }|j|qW|S)Nr)itemspopr(rrappend) old_group new_group statisticsrstatZpreviousrrr_compare_grouped_statsts   r2c@seZdZdZdZddZeddZeddZd d Z d d Z d dZ ddZ ddZ dS)Framez Frame of a traceback. _framecCs ||_dS)N)r4)rframerrrrszFrame.__init__cCs |jdS)Nr)r4)rrrrfilenameszFrame.filenamecCs |jdS)N)r4)rrrrlinenosz Frame.linenocCs|j|jkS)N)r4)rrrrrrsz Frame.__eq__cCs|j|jkS)N)r4)rrrrr__lt__sz Frame.__lt__cCs t|jS)N)rr4)rrrrrszFrame.__hash__cCsd|j|jfS)Nz%s:%s)r6r8)rrrrr sz Frame.__str__cCsd|j|jfS)Nz)r6r8)rrrrr!szFrame.__repr__N)r4)r#r$r%r&r'rpropertyr6r8rr9rr r!rrrrr3s      r3c@seZdZdZdZddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ dddZdS) Tracebackz` Sequence of Frame instances sorted from the most recent frame to the oldest frame. _framescCstj|||_dS)N)rrr<)rframesrrrrs zTraceback.__init__cCs t|jS)N)lenr<)rrrr__len__szTraceback.__len__cCsBt|tr-tdd|j|DSt|j|SdS)Ncss|]}t|VqdS)N)r3).0tracerrr sz(Traceback.__getitem__..) isinstanceslicetupler<r3)rindexrrr __getitem__szTraceback.__getitem__cCs|j|jkS)N)r4r<)rr5rrr __contains__szTraceback.__contains__cCs t|jS)N)rr<)rrrrrszTraceback.__hash__cCs|j|jkS)N)r<)rrrrrrszTraceback.__eq__cCs|j|jkS)N)r<)rrrrrr9szTraceback.__lt__cCst|dS)Nr)str)rrrrr szTraceback.__str__cCsdt|fS)Nz)rE)rrrrr!szTraceback.__repr__NcCsg}|dk r"|dkr"|Sxj|d|D]X}|jd|j|jftj|j|jj}|r3|jd|q3W|S)Nrz File "%s", line %sz %s)r-r6r8 linecachegetlinestrip)rlimitlinesr5linerrrformats zTraceback.format)r<)r#r$r%r&r'rr?rGrHrrr9r r!rPrrrrr;s          r;cCs*t|}|dk r"t|SdSdS)z Get the traceback where the Python object *obj* was allocated. Return a Traceback instance. Return None if the tracemalloc module is not tracing memory allocations or did not trace the allocation of the object. N)rr;)objr=rrrget_object_tracebacks   rRc@s|eZdZdZdZddZeddZeddZd d Z d d Z d dZ ddZ dS)Tracez" Trace of a memory block. _tracecCs ||_dS)N)rT)rrArrrrszTrace.__init__cCs |jdS)Nr)rT)rrrrrsz Trace.sizecCst|jdS)Nr7)r;rT)rrrrrszTrace.tracebackcCs|j|jkS)N)rT)rrrrrrsz Trace.__eq__cCs t|jS)N)rrT)rrrrrszTrace.__hash__cCsd|jt|jdfS)Nz%s: %sF)rrr)rrrrr sz Trace.__str__cCsdt|jd|jfS)NzF)rrr)rrrrr! szTrace.__repr__N)rT) r#r$r%r&r'rr:rrrrr r!rrrrrSs     rSc@sXeZdZddZddZddZddZd d Zd d Zd S)_TracescCstj|||_dS)N)rr_traces)rtracesrrrrs z_Traces.__init__cCs t|jS)N)r>rV)rrrrr?sz_Traces.__len__cCsBt|tr-tdd|j|DSt|j|SdS)Ncss|]}t|VqdS)N)rS)r@rArrrrBsz&_Traces.__getitem__..)rCrDrErVrS)rrFrrrrGsz_Traces.__getitem__cCs|j|jkS)N)rTrV)rrArrrrH sz_Traces.__contains__cCs|j|jkS)N)rV)rrrrrr#sz_Traces.__eq__cCsdt|S)Nz)r>)rrrrr!&sz_Traces.__repr__N) r#r$r%rr?rGrHrr!rrrrrUs      rUcCs5tjj|}|jdr1|dd}|S)Nz.pycr7)ospathnormcaseendswith)r6rrr_normalize_filename*sr]c@sXeZdZddddZeddZddZd d Zd d ZdS) FilterNFcCs.||_t||_||_||_dS)N) inclusiver]_filename_patternr8 all_frames)rr_filename_patternr8rarrrr2s  zFilter.__init__cCs|jS)N)r`)rrrrrb9szFilter.filename_patterncCsIt|}tj||js%dS|jdkr8dS||jkSdS)NFT)r]fnmatchr`r8)rr6r8rrrZ __match_frame=s  zFilter.__match_framecCs|j|||j AS)N)_Filter__match_framer_)rr6r8rrr _match_frameFszFilter._match_framecs^jr:tfdd|Dr/jSj Sn |d\}}j||SdS)Nc3s'|]\}}j||VqdS)N)rd)r@r6r8)rrrrBKsz*Filter._match_traceback..r)raanyr_re)rrr6r8r)rr_match_tracebackIs   zFilter._match_traceback) r#r$r%rr:rbrdrergrrrrr^1s  r^c@seZdZdZddZddZeddZdd Zd d Z d d Z dddZ dddZ dS)SnapshotzB Snapshot of traces of memory blocks allocated by Python. cCst||_||_dS)N)rUrWtraceback_limit)rrWrirrrrZszSnapshot.__init__c Cs3t|d}tj||tjWdQRXdS)z1 Write the snapshot into a file. wbN)openpickledumpHIGHEST_PROTOCOL)rr6fprrrrm`sz Snapshot.dumpc Cs*t|d}tj|SWdQRXdS)z. Load a snapshot from a file. rbN)rkrlload)r6rorrrrqgsz Snapshot.loadcs`|d|r3tfdd|Ds3dS|r\tfdd|Dr\dSdS)Nr7c3s|]}|jVqdS)N)rg)r@ trace_filter)rrrrBrsz)Snapshot._filter_trace..Fc3s|]}|j VqdS)N)rg)r@rr)rrrrBvsT)rf)rinclude_filtersexclude_filtersrAr)rr _filter_traceos   zSnapshot._filter_tracecst|ts(tdt|j|rggx4|D],}|jr`j|qAj|qAWfddjjD}njjj }t |j S)z Create a new Snapshot instance with a filtered traces sequence, filters is a list of Filter instances. If filters is an empty list, return a new Snapshot instance with a copy of the traces. z)filters must be a list of filters, not %scs+g|]!}j|r|qSr)ru)r@rA)rtrsrrr s  z*Snapshot.filter_traces..) rCr TypeErrortyper#r_r-rWrVcopyrhri)rfiltersrrZ new_tracesr)rtrsrr filter_traces{s  (zSnapshot.filter_tracesc CsG|dkrtd|f|rA|d krAtd|i}i}|sTx|jjD]}|\}}y||}Wnstk r|dkr|} n6|dkr|dd} n|dddff} t| }|||s*      &0 # 5 ! $