bg]lGddeZGddeZGddeZGddeZGdd eZGd d eZGd d ZGddZGddeZ GddeZ GddeZ Gdde Z GddZ dS)cHeZdZdZdZdZdZdZdZdZ dZ d Z d Z d S) Formatimplmodc,||_|j|_dSNr)selfrs G/opt/cloudlinux/venv/lib64/python3.11/site-packages/guppy/heapy/Part.py__init__zFormat.__init__s 8c ||}g}|jd}t|dz}||j||dz|jj||ddD]=}||j||jj||>d|S)N  widthsubsequent_indent)rinitial_indentr) get_stat_datanamesplitlenextendrwrap line_lengthjoin)r rowfrrowsrsrrs r get_formatted_rowzFormat.get_formatted_rows    $ $ X^^D ! !GGCK DHMM r!uH(&/"11 2 2 2 ABB 6 6A KK h*0"3 &55 6 6 6 6 yyr c|j}|dd\}}}t|}t|}|xj|z c_t ||||j|jS)Nrrrintcum_sizeStatRow cur_index)r r"rcountsizekinds r load_statrow_cskzFormat.load_statrow_csksayGGCOOtTE 4yy  udD$.$-HHHr c|j}|dd\}}t|}|xj|z c_t d|||j|jS)Nrrr&)r r"rr,r-s r load_statrow_skzFormat.load_statrow_sk"sSyWWS!__ d4yy  q$dndmDDDr c|jjSrrnumrowsr s r _oh_get_num_lineszFormat._oh_get_num_lines)s y  r c*|Sr) get_labelr4s r _oh_get_labelzFormat._oh_get_label,s~~r c|j}|js |jsdS|}|j||jjz|jjdt|zS)Nrr) rr+r,get_stat_headerrfill kindheaderrr)r rshs r _oh_get_row_headerzFormat._oh_get_row_header/sqy  di 2  ! ! # #x}} % %(&!#b''k++ +r c0|jj|dzz }d|zS)Nrz+<%d more rows. Type e.g. '_.more' to view.>r2)r start_lineno end_linenonummores r _oh_get_more_msgzFormat._oh_get_more_msg9s )#Z\2y :??AAAJ J49N&& &r c0d|j|j|jfzSNz%d %d %sr+r,rr rs r get_rowdatazSetFormat.get_rowdataNSY#(;;;r c dS)Nz- Index Count % Size % Cumulative % rMr4s r r;zSetFormat.get_stat_headerQs ; = =r c d}|j}||j|jtd|jdz|jz z|jtd|jdz|jz z|jtd|jdz|jz zfz}|S)Nz%6d %6d %3d %8d %3d %9d %3d z%.0fY@)rindexr+r'r, cumulsize)r rformatrrs r rzSetFormat.get_stat_dataUs/y  I Is6SY%6tz%ABCC Hc&CHu$4TY$>?@@ M3v)>ty)HIJJ     r c,||Srr.r r"s r load_statrowzSetFormat.load_statrow`$$Q'''r N rIrJrKrLr7rWr;rrbrMr r rOrOBsdI&&&<<<===   (((((r rOc0eZdZdZdZdZdZdZdZdS)IdFormatrMc`|j}|jdkrd}nd}d|j|j||jfzS)NrrQr:z-Set of %d %s object%s. Total size = %d bytes.)rr+kindnamer,partrRs r r7zIdFormat.get_labelgsAy :??AAA ; DM1di?9 9 :r c$d|j|jfzS)Nz%d %s)r,rrVs r rWzIdFormat.get_rowdatars#(CH---r c dS)Nz& Index Size % Cumulative % rMr4s r r;zIdFormat.get_stat_headerus 4 6 6r c|j}d}||j|j|jdz|jz |j|jdz|jz fz}|S)Nz%6d %8d %5.1f %9d %5.1f r[)rr\r,r]r rrr^rs r rzIdFormat.get_stat_dataysSy+  I Hsx%' 1 M3=50:    r c,||Sr)r0ras r rbzIdFormat.load_statrows##A&&&r NrdrMr r rfrfdsdI   ...666'''''r rfc6eZdZdZdZdZdZdZdZdZ dS) DiffFormatrMcR|jjdkrd|dz|jjz fzSdS)Nrz%9.3gr[z (n.a.))rb_size)r r,s r _percent_of_bzDiffFormat._percent_of_bs3 9 q d5j)99;; ;;r c|j}dd|j|jz|j|jzfzzd|j|jfzzd|j|j||jfzz}|js|jr|dz }|S)Nz>Summary of difference operation (A-B). Count Size z A %6d %8d z B %6d %8d z A-B %6d %8d = %s %% of B z8 Differences by kind, largest absolute size diffs first.)rr+b_countr,rrrs)r rxs r r7zDiffFormat.get_labelsy ' $*T\"949T[;P!Q Q R $, !< < = - DItGYGYZ^ZcGdGd/e e  f  : M M L LAr c0d|j|j|jfzSrTrUrVs r rWzDiffFormat.get_rowdatarXr c dS)Nz+ Index Count Size Cumulative % of B rMr4s r r;zDiffFormat.get_stat_headers 9 ; ;r c|j}d}||j|j|j|j||jfz}|S)Nz%6d %6d %8d %9d %s )rr\r+r,r]rsrms r rzDiffFormat.get_stat_datasKy&  I I H M   s} - -    r c,||Srr`ras r rbzDiffFormat.load_statrowrcr N) rIrJrKrLrsr7rWr;rrbrMr r rprpssI   <<<;;;   (((((r rpceZdZdZddZdS)r)r+r,rr\r]NcL||_||_||_||_||_dSrr|)r r+r,rr\r]s r r zStatRow.__init__s)    "r )NNrIrJrKrLr rMr r r)r)s-=I######r r)ceZdZdZdZdS)PartRow)setr-ch||_||_||_||_||_||_||_dSr)r+r,rr\r]rr-)r r+r,rr\r]rr-s r r zPartRow.__init__s7    " r Nr~rMr r rrs(Ir rcXeZdZddZdZdZdZddZdZd Z dd Z d Z ddZ dZ dS)Statr:c^||_|j|_||_||_t ||_d|_d|_g|_| }|r| ds|d| d}|| ddzd } t|}n#t$rYnwxYwt|||| }|r| d|j|_t%|j|j|_|||_t)|j|_|jj||jdS)Nrz.r:r:)r _hiding_tag_ get_trows firstheaderiteritr*r(r get_next startswithr\stripr' ValueErrorsetattrr^ format_namegetattr format_classfloattimemadeOutputHandlingsetup_printing)r rrrr"rvalues r r z Stat.__init__s,"&yy{{##  MMOO  U++ Qqwws||^$Daggcll1noo&,,..E E      D$ & & & A  U++  ;#DHdk::''-- dm,,  ..tT[AAAAAsC C+*C+c pt|trJ|dkr j|z}d|cxkr jksntd|g}n`t|t r<|j\}}}fdt|||D}ntdd}d}|D]}||jz }||j z }ddj zdj zd|zd |zd j zd j zd t|zg} td d:| djz| djz|D]2}| dj|z3j| S)NrzStat index out of range.c:g|]}|SrM)get_row).0idxr s r z$Stat.__getitem__..s%JJJ#DLL%%JJJr z(Stat indices must be integers or slices..loader: _load_stat .format: %s .timemade: %f .count: %d .size: %d.kindheader: %s .kindname: %s .numrows: %dru .b_count: %d .b_size: %d.r: %s) isinstancer'r3 IndexErrorrsliceindicesranger+r,rrr=rhrrappendrurrr^rWrload) r rr startstopstepr+r,r"trowss ` r __getitem__zStat.__getitem__s c3   IQwwlS(++++t|++++ !;<<<LL%%&DD U # # I # DL 9 9 E4JJJJudD1I1IJJJDDGHH H  A QW E AFNDD " D, , dm + 5 $   / dm + SYY &   4D ) ) 5 LL$,6 7 7 7 LL4 5 5 5 @ @A LLDK$;$;A$>$>> ? ? ? ?x}}U###r c|jSr)r3r4s r __len__z Stat.__len__s |r c Ht|tstd|j|jkr t d|jd|jdg}i}i}|D]h}||j}|r@t|j |j z|j |j z|j|j d||j<^|||j<i|D]}||j}|r'||j=|j |j z }|j |j z }n|j }|j }|dkr|dkr`||j} | r!| xj |z c_ | xj |z c_ t|||j} | || j<| | t|} | d| D]D}t|j |j |j} | j|vsJ| | E|dd d} d} |D]}| |j z } | |j z } | |_d d d |jjzd|j zd|j zd| zd| zd|jzd|jzdt)|zg } |D],}| d|j |j |jfz-|j| S)Nz2Can only take difference with other Stat instance.zMismatching table kind header, z vs .rc|jSr)r\rvs r zStat.__sub__..8sagr )keyc*t|jSr)absr,rs r rzStat.__sub__..=sAF r Trreverserz.format: DiffFormatrrrrrrrrz .r: %d %d %s)rr TypeErrorr=rrGgetrr)r+r,r\rlistvaluessortr]rtimerhrr)r otherr otabstabr"or+r,srr! cumulcountr]rs r __sub__z Stat.__sub__sa%&& FDFF F ?e. . .*!1!1!1344 4!! ! !A  A !&GAGOQVAF]AFAGd L LQV  !QV   A  A L!')vvzzdaii!&!!B E!4UD!&11 "RW  B $++--  %%&&&  A!'AF7AF33B7$&&&& KKOOOO ++T :::   $ $A !' !J  I#AKK ! ! dhm0022 2 U[ ( EJ & : % ) #  / dm + SYY &   E EA LL17AFAF*CC D D D Dx}}U###r act|dst||}n|} |D]*}|dddks|dz }||+d|jz}||kr||||ur|dSdS#||ur|wwxYw)Nwriterz.end: .loader: %s )hasattropenrrloaderclose)r fnmodefr"ends r dumpz Stat.dumpTsr7## RAAA ^^%%  v~~IA '$+5CCxx {{ {q{{ s A$B%%Cc t|j}|d}n#t$rd}YnwxYw||_|S)Nr)nextrrstrip StopIterationlastras r rz Stat.get_nextes[ TW AAA   AAA  s , ;;c|t|jkr,||t|jk,|j|Sr)rr parse_next_rowr rs r rz Stat.get_rowosHS^^##    ! ! !S^^##y~r rc#K||jkr> ||}|Vn#t$rYdSwxYw|dz }||jk.sAGr Trrzr) rrGrrrFr+r,r)r) r rsortbyr retrowsrr]rr" othercount othersizers r get_rows_n_and_otherzStat.get_rows_n_and_others * * *KLL L }} W  ::D II++TI : : :  oo * *FQAvv!Z*4  I 1  ) )++V##"+G"4"4..A6I--,17GAaCL!E. u---w&&"+G"4"4..A7Z//,17GAaCL!E0 u---1 !' !J  I NN1    ++++ ))))r cz|j}|std|drd|dd}|j|}|xjdz c_|j||dS|drtdt)NzRow index out of range.z.r: rz.end) rrrr^rbr*r rr SyntaxError)r r"rs r rzStat.parse_next_rows I 8677 7 <<   !""A))!,,B NNa NN I  R MMOOO F \\& ! ! 677 7 r Nr:)r)r)r)rIrJrKr rrrrrrrGrrrrMr r rrsBBBB>"$"$"$H?$?$?$B" *8888tr rcBeZdZdZdZd dZdZd dZdZdZ d Z dS) Partitionc||_||_||_|j|_|j|_dSr)rrerrrr)r rrrs r r zPartition.__init__s7,  r c*|Sr)get_setsr4s r __iter__zPartition.__iter__s}}r Nc#tK|d} ||}|Vn#t$rYdSwxYw|dz }2r)rr)r rowindexrs r rGzPartition.get_rowssm  H  ll8,,      MH s # 11c"t|trV||j\}}}||||}|j||jS|dkr ||jz }||S)Nrr) rrrr3 get_nodesetridsetr get_rowset)r r\rrrnss r get_setzPartition.get_sets eU # # * % dl ; ; E4!!%t44B8>>">11 1qyy%??5)) )r c#fKt|jD]}||VdSr)rr3r)r r\rs r rzPartition.get_setssD&& ' 'C//#&& & & & & ' 'r ct|fd}|j|S)NcSrrM)rsr rz%Partition.get_stat..get_trows sLr )rrr _load_stat)r rrs @r get_statzPartition.get_statsIT^^%%&&     x""9---r c#:KdVd|jjjzVd|jzVd|jzVd|jzVd|jzVd|jzVd|jzV| D]!}d |j |zV"dS) Nrrrrrrrrr) r^ __class__rIrr+r,rhr=r3rGrWrVs r rzPartition.get_trowss####dk3<<<<< ----TZ''''DI%%%% ----$/1111t|++++==?? : :CT[44S999 9 9 9 9 : :r cp|||_|jj||jdSr)r^rrr)r FormatClasss r init_formatzPartition.init_formats6!k$''  ..tT[AAAAAr r) rIrJrKr rrGr rrrrrMr r rrs(((    ***''''... : : :BBBBBr rceZdZdZdZdS)IdentityPartitionClusterobjectslocounthicountlosizeobsizeissortedc`||_||_||z|_||_||_d|_dS)NFr)r rrr+rrs r r z!IdentityPartitionCluster.__init__)s4  u}    r Nr~rMr r rr"s+ PIr rc,eZdZdZdZdZdZdZdS)IdentityPartitionc Zt||||g}|jj|j}||d}d}|D]_\}} t| } | t|j | || ||||| zz }|| z }`||j ksJd|_||_||_ |jjx|_} | j| |_| j| |_||_| j| |_||_| j| |_|t<dSNr)rr r classifier partition_clinodesrrrrrrobservation_listr+cluidxclustersbyclodor-famc_get_idpart_headerr=c_get_idpart_labelrhr3c_get_idpart_renderrenderr,c_get_idpart_sortrender sortrenderrrf) r rrrr( sizeclassestotcounttotsizer,vr+r-s r r zIdentityPartition.__init__3s4c2...h)77 BB "  GD!FFE OO4))!,,hwNN O O O te| #G  HH39$$$$    ;++ D(66t<<33D99  h22488  (::4@@ """""r c<||||dSr")get_nodeset_cluster)r rrrs r rzIdentityPartition.get_nodesetQs''tT::1==r c |dkrtd|j}||kr|dfS|j}d}t |}|j}||kr5||} | j|kr|| jkrn|dz}n|}||zdz}||k5|dfS| } | j || jks|| jks|dkr| j s|j dkr } n fd D} dt| D} | |j fd| Dx| _ d | _ || jz || jz | | z}||_|t |zz }||krnJt|dzt |D]&}||} | j|cxkr | jkrn$n'n6|| fS) NrStep must be positive.rr%IDENTITYc&g|] }|SrMrM)rrvr0s r rz9IdentityPartition.get_nodeset_cluster..us!===jjmm===r cg|] \}}||f SrMrM)rrr-s r rz9IdentityPartition.get_nodeset_cluster..vs AAA44)AAAr c&g|] \}}|SrMrM)rr-rrs r rz9IdentityPartition.get_nodeset_cluster..ys!888 q888r T)rr mutnodesetr(rr'rrrrr0rFrr&r)r rrrr r(lohir'clu clu_to_returnksrr0s @@r r6z%IdentityPartition.get_nodeset_clusterTsZ 199566 6 X " " D==: =  ]]2gg6"C{e##3;&&!BB2g!^F2gg:   kG ##tck'9'9TQYY| (!%J!Z//$====W===AA9R==AAABGGIII,0H,E,E8888R888-:-::CK'#'CL!% "3D4DT"IJ 'MB DK S\\$& &E}} CMM::  v&;%5555#+55555E65 6M""r c H|||dzd\}}|std|j||j}t d|j||j||dz|j z |jz|j z||j }|SNrPartition index out of range.r) r6rrrrrrr.theonerrr-)r rowidxr r@virs r rzIdentityPartition.get_rows**66!8Q??C ><== = X^^B47^ + +aT[[%;%;vax 3SZ?#*L"'## r c|||dzd}|std|j||jSrD)rrrrr)r rGr s r rzIdentityPartition.get_rowsetsN   ffQh 2 2 ><== =x~~bTW~---r N)rIrJrKr rr6rrrMr r r r 2s`###<>>>4#4#4#l.....r r c&eZdZdZdZdZdZdS) SetPartitionc 6 t|||||j fd |jD}|d}g}|D]I\}}} } | } || z }|t| j| |t||| | J|j|_ d|_ d|_ t||_ ||_||_|t"dS)NcVg|]%\}}|j |d||f&Sr)r,get_tabrendering)rr-rir#s r rz)SetPartition.__init__..sPGGG"tTI:z::4DDdDQGGGr rr:)rr r# partitionr%rrrr+r get_tabheaderr=rhr3r r,rrO) r rrrtosortr]r minusizerr-rir,r#s @r r zSetPartition.__init__s?4c2...] GGGG&0&:&:39&E&EGGG  ,2   (XtT49D  I KK D$D 9d     Y $22266 4yy    #####r c|dkrtd|j}||kr%||j|jjz}||z }||k%|S)Nrr8)rrr=r rr%)r rrrr s r rzSetPartition.get_nodesetsh 199566 6 X " "dll $)E"&, ,B TMEdll r cX |j|S#t$rtdwxYw)NrE)r rrs r rzSetPartition.get_rows= >9S> ! > > ><== = >s )c||}|j} |jn0#t$r#|j|||_YnwxYw|Sr)rr _partitionAttributeErrorr_fast_partition)r rrrs r rzSetPartition.get_rowsetsjll3g A NNN A A A!X55dC@@CNNN A s&*AAN)rIrJrKr rrrrMr r rKrKsP$$$4>>> r rKceZdZdZdS) FastPartitionct|||j|j|j|_|j|_d|_d|_|g|_|j |_ | tdS)Nr:r) rr rrr+r=rhr3r r,rrO)r rparentrs r r zFastPartition.__init__sm4fj&)<<<Y  +  E H  #####r N)rIrJrKr rMr r rZrZs# $ $ $ $ $r rZc4eZdZdZdZdZdZdZdZdZ dZ d S) _GLUECLAMP_)r)r backup_suffix) z_parent.ImpSet:mutnodesetz_parent:OutputHandlingz_parent.Use:Idz_parent.Use:Sizez_parent.Use:idsetz_parent.Use:loadz_parent.View:_hiding_tag_z_parent.View:observation_listz_root.os:renamez_root.textwrap:fill_root.textwrap:wrapr`z _root:timedz.oldcl|j|jjurt|||St|||Sr)r#Idr rK)r rrs r rOz_GLUECLAMP_.partitions8 =DG. . .$T333 3c2.. .r c"t||Sr)r)r rs r rz_GLUECLAMP_._load_statsD)$$$r c$t|||Sr)rZ)r r\rs r rXz_GLUECLAMP_._fast_partitionsT63///r N) rIrJrK _preload_ _chgable_ _imports_rr_rOrrXrMr r r^r^s^!I0II$KM///%%%00000r r^N)objectrrOrfrpr)rrrrr rKrZr^rMr r rjsK>.>.>.>.>.V>.>.>.B((((((((D ' ' ' ' 'v ' ' 'F*(*(*(*(*(*(*(*(Z#####f###     g   QQQQQQQQh?B?B?B?B?B?B?B?BD     v    f.f.f.f.f. f.f.f.R111119111h $ $ $ $ $L $ $ $%0%0%0%0%0%0%0%0%0%0r