bg1\HddlZGddejjjZdS)NceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd2dZdZdZd3dZd4dZdZd5dZdZdZdZd6dZd7dZd7dZd8dZd9d Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d,Z)d-Z*d.Z+d/Z,d0Z-d1Z.dS): _GLUECLAMP_) _hiding_tag_)reprefixdefault_reprefixgcobjsrelheaprelheapgrelheapu__doc__)AnythingClodoIdIdsetModuleNothingProdRcsRootSizeTypeUnityViadocfindexheapheapuidsetisoloadmonitorpbsetreftest)Viewr _load_stat_check_tracemallocctimerdumphrheapgloadcr r r r setrelheap setrelheapg setrelheaputc_adapttc_reprunionuniset_from_setcsatablewarningsStatzhpy().c|jSNrselfs F/opt/cloudlinux/venv/lib64/python3.11/site-packages/guppy/heapy/Use.py _get_gcobjsz_GLUECLAMP_._get_gcobjs |c|jSr6r7r8s r: _get_relheapz_GLUECLAMP_._get_relheapr<r=c|jSr6r7r8s r: _get_relheapgz_GLUECLAMP_._get_relheapgr<r=c|jSr6r7r8s r: _get_relheapuz_GLUECLAMP_._get_relheapu"r<r=cddl}t|jD]9\}}t ||jrt |dd|jurd|zcS:|jS)Nr_sharez%s.) __main__list__dict__items isinstance __class__getattrrEr)r9rFkvs r: _get_reprefixz_GLUECLAMP_._get_reprefix%s~ *002233 ! !DAq1dn-- !Ax..$+==qy   $$r=c$|jjjS)a[Root: RootStateType This attribute is a symbolic root containing attributes from which all reachable objects in the heap can be reached. It is the only value (a singleton) of its kind; see [1] for a description of its attributes. References [0] heapy_Use.html#heapykinds.Use.Root [1] heapy_RootState.html#heapykinds.RootStateType)r%heapyc RootStater8s r: _get_Rootz_GLUECLAMP_._get_Root1sy))r=c8d|jd|jdddS)Nz&Top level interface to Heapy. Use eg: zdoc for more info on .)rr8s r:__repr__z_GLUECLAMP_.__repr__>s, MMM4="---/ /r=cZ|}|jjjj||S)aL #OBSOLETE $HP.dir(opts: str+])-> GuppyDir $HP.dir(opts: str+]). -> GuppyDoc A replacement for the builtin function dir(), providing a listing of public attributes for Heapy objects. It also has an attribute for each item in the listing, for example: >>> $HP.dir().heap returns a GuppyDoc object providing documentation for the heap method. The method also takes a string argument specifying further options. Currently the following are provided: 'l' Generate a listing of the synopsis lines. 'L' Generate a listing of the entire doc strings.)_rootguppyetcHelpdir)r9optsobjs r:Ddirz_GLUECLAMP_.DdirDs*&z#(,,S$777r=cj|jjjj|dd|jzS)aOverview documentation for top level Heapy object. Provides a listing of the available attributes. Accessing the attribute name on the doc objects gives further info, eg: >>> hp.doc.heap gives doc for the heap method when hp is the top level Heapy object. References may be embedded in the documentations. To access a reference, opening up a web browser with the doc for it one can do eg: >>> hp.doc.heap[1] The reference number 0 is special. If it is provided, it is the reference to the html doc for the described object itself. So to see in the web browser the doc for the heap method one can do: >>> hp.doc.heap[0] References [0] heapy_Use.html#heapykinds.Use.docz3Top level interface to Heapy. Available attributes:z2Use eg: %sdoc. for info on .)headerfooter)rZr[r\r]r^rr8s r:_get_docz_GLUECLAMP_._get_docZsF.z#(,,T57568< 5F-GG Gr=c|jjdkr|jd|jst ddS)N)zoPython 3.7 and below tracemalloc may not record accurate producer trace. See https://bugs.python.org/issue35053zqTracemalloc is not tracing. No producer profile available. See https://docs.python.org/3/library/tracemalloc.html)sys version_infor3warn tracemalloc is_tracing RuntimeErrorr8s r:r'z_GLUECLAMP_._check_tracemallocwsv 8 6 ) ) M  I J J J**,, JIJJ J J Jr=c|jd|j|}||jz}|S)z DEPRECATED zIMethod Use.heapg is depreciated, it doesn't work well. Use heapu instead.)r3rkr%r*r )r9rmahs r:r*z_GLUECLAMP_.heapgsF  W Y Y Y IOOC  T]r=rc|j|}d}|s5|jr.t|jt |r ||jz}d}|r|j}|s5|jr.t|jt |r ||jz}d}d|_|r0|xjd||jjzz c_|xjdz c_|S)aheapu() -> Stat Finds the objects in the heap that remain after garbage collection but are _not_ reachable from the root. This can be used to find objects in extension modules that remain in memory even though they are gc-collectable and not reachable. Returns an object containing a statistical summary of the objects found - not the objects themselves. This is to avoid making the objects reachable. See also: setref[1] References [0] heapy_Use.html#heapykinds.Use.heapu [1] heapy_Use.html#heapykinds.Use.setrefrrozData from unreachable objectsz relative to: %sz. ) r%rr rJtypestat firstheaderr(timemade)r9rqabsrurrrels r:rz_GLUECLAMP_.heapus$ IOOC  t} DM477)K)K   AC  #A 4= Z tAww-O-O T]";AM D !3!%DM,B!C!C"DD MMU "MMr=c`|j}||jz}||jz}|S)aheap() -> IdentitySet[1] Traverse the heap from a root to find all reachable and visible objects. The objects that belong to a heapy instance are normally not included. Return an IdentitySet with the objects found, which is presented as a table partitioned according to a default equivalence relation (Clodo [3]). See also: setref[2] References [0] heapy_Use.html#heapykinds.Use.heap [1] heapy_UniSet.html#heapykinds.IdentitySet [2] heapy_Use.html#heapykinds.Use.setref [3] heapy_Use.html#heapykinds.Use.Clodo)r%rrr )r9rrs r:rz_GLUECLAMP_.heaps2" INN   T[ T\r=ct ttrt fd}ntdrtdsfd}ntdr|rj}nj}g |}|st d|z} |r( |||krn|}|(t n%#t $r |YnwxYw fd}ntdtt|}| dstd z|| d d zd } t||}n$#t $rtd d|dwxYw||S)aload(alt:[fn: loadablefilenamestring+ or fn: loadableiterableofstrings+] [use_readline = boolean+]) -> Stat Load heapy-related data from a serialized form. Currently it handles data generated by Stat.dump. Arguments fn: loadablefilenamestring+ A string argument is treated as a file name. fn: loadableiterableofstrings+ An open file or an iterator will be iterated over enough to read one package of data, and another call to load will read the next package. use_readline = boolean+ If true, the method will use .readline() instead of iteration, which may be necessary in case the input comes from a pipe since otherwise the Python runtime would try to read ahead a big block before returning the first package of data. Returns one package of statistical data. References [0] heapy_Use.html#heapykinds.Use.loadc3Kd} |}|sdS}|VF)Nr)seekreadlinetell)poslinefs r: get_trowsz#_GLUECLAMP_.load..get_trowssUFF3KKK::<.get_trowss r=z.end: %scSr6r)trowssr:rz#_GLUECLAMP_.load..get_trowss r=zBArgument should be a string, file or an iterable yielding strings.z.loader:z1Format error in %r: no initial .loader directive.:roNzFormat error in z: no such loader: rV)rJstropenhasattrr~r StopIterationappend TypeErrornextiter startswith ValueErrorindexstriprLAttributeError) r9r use_readlinerget_linerendlinealoaderrrs ` @@r:r z_GLUECLAMP_.loads8 b#  ; VRA      R $ $' VWR-D-D' V       R $ $# V ';;E8::D $## 4'G &(LL&&&w#8::D ( ('! & & & W%%%%% &      TVV V iikk"" # #||J'' JCbHJJ J1773<<>??#))++ JT6**FF J J J*=?RRHJJ J Jvi   s1CC$#C$:F !F,c#Kt|trt|} ||V)z< Generates all objects from an open file f or a file named f)rJrrr )r9rs r:loadallz_GLUECLAMP_.loadall*sC a   QA ))A,,    r=cpt|dd} t||d%)Nrro)r)rprintr )r9rrs r:r+z_GLUECLAMP_.loadc1s; S!   0 $))AA).. / / / 0r=ct|d}ddl} |}|j||t t|q)Nwr) rgcrrudumpflushrlen get_objects)r9rrrxs r:r)z_GLUECLAMP_.dumph6sm SMM  ) A FKKNNN GGIII #bnn&&'' ( ( (  )r=Nc|,|*||dS||||||dSdS)asetref() Set a reference point for heap usage measurement. This applies to both the heap[1] and heapu[2] methods. The heap() method will only show the objects allocated after the time setref was called. The heapu() method, since it deals with summary data and not actual objects, will show the difference of sizes and counts compared to when setref was called. References [0] heapy_Use.html#heapykinds.Use.setref [1] heapy_Use.html#heapykinds.Use.heap [2] heapy_Use.html#heapykinds.Use.heapuN)r,r.)r9 reachable unreachables r:r#z_GLUECLAMP_.setref?sw  !4 OO           $ ***&  -----'&r=cJ||j}||_dSr6)r%rr r9 references r:r,z_GLUECLAMP_.setrelheapWs$   ((I  r=c|jd| d|_|j}||_dS)Nz:Method Use.setrelheapg is depreciated, use setref instead.)r3rkr r%r*rs r:r-z_GLUECLAMP_.setrelheapg\sK  H J J J   DM ))I! r=c|d|_|d|}|rt||js|j}||_dS)NT)rxru)r rrJr4ru)r9rrus r:r.z_GLUECLAMP_.setrelheapudsQ   DM t$ 77I  ' 9di88 '!I! r=FcN|jjj|dS)ztest([debug: bool+ = False]) Run the Heapy test suite. Argument debug If True, the tests will be run in debug mode so the stack frame can be examined with pdb.pm() after the first exception.N)_parentr$test_all test_main)r9debugs r:r$z_GLUECLAMP_.testls& ",,U33333r=)z_parent.Classifiers:Clodoz_parent.Classifiers:Idz_parent.Classifiers:Idsetz_parent.Classifiers:Modulez_parent.Classifiers:Prodz_parent.Classifiers:Rcsz_parent.Classifiers:Sizez_parent.Classifiers:Typez_parent.Classifiers:Unityz_parent.Classifiers:Viaz_parent.Classifiers:findexz_parent.Classifiers:sonokindz_parent.Classifiers:tc_adaptz_parent.Classifiers:tc_reprz_parent.Monitor:monitorz_parent.Part:_load_statz_parent.Part:Statz_parent.Prof:pbz_parent.UniSet:Anythingz_parent.UniSet:idsetz_parent.UniSet:isoz_parent.UniSet:Nothingz_parent.UniSet:unionz&_parent.UniSet:uniset_from_setcastablez _parent:Viewz_parent.View:_hiding_tag_z _root:sysz_root:tracemallocz_root.time:ctimez_root:warningszAnything: Kind A symbolic set that represents all possible Python objects. References [0] heapy_Use.html#heapykinds.Use.AnythingadClodo:EquivalenceRelation Clodo(alt:[tc: typeexceptdict+ or dictof = typeoremptytuple+]) -> Kind Equivalence relation by class or dict owner. It distinguishes between objects based on their type just like the Type relation, and in addition distinguishes between dicts depending on what class they are 'owned' by, i.e. occur in __dict__ attribute of. When called it returns the equivalence class defined by the argument, EITHER: tc: A positional argument, a type but not a dict, to create the corresponding equivalence class. OR: dictof: A named argument, to create an equivalence class consisting of all dicts that are owned by objects of the type specified in the argument; or dicts with no owner if an empty tuple is given. XXX express this simpler&better... References [0] heapy_Use.html#heapykinds.Use.ClodoaYId:EquivalenceRelation Id(address: objectaddress+) -> Kind) This equivalence relation defines objects to be equivalent only if they are identical, i.e. have the same address. When called it returns the equivalence class defined by the argument: address: The memory address of an object. References [0] heapy_Use.html#heapykinds.Use.IdaId:EquivalenceRelation Idset(node: Anything+) -> IdentitySet This equivalence relation defines objects to be equivalent only if they are identical, i.e. have the same address. When called it returns the equivalence class defined by the argument: node: Anything+ Any object is a valid argument. Note This is mainly for special purpose internal use. The Id equivalence relation is more efficient when partitioning large sets.aModule:EquivalenceRelation x.Module( draw:[name = modulename+ , at = moduleaddress+]) -> Kind This equivalence relation defines objects to be equivalent if they are the same module, or if none of them is a module. Partitioning a set of objects using this equivalence relation will therefore result in one singleton set for each module and one set containing all other objects. Calling the Module equivalence relation creates a Kind containing the module given in the keyword argument(s). Either the name, address or both may be specified. If no argument is specified the equivalence class is that of non-module objects. References [0] heapy_Use.html#heapykinds.Use.Modulez^Nothing: IdentitySet The empty set. References [0] heapy_Use.html#heapykinds.Use.NothingaProd: EquivalenceRelation Prod() -> KindOfProdFamily[1] Prod(path_prefix: string+) -> Kind Prod(scope: Anything+) -> Kind Prod(seq: [filename: string+, alt: positive+]) -> KindOfProdFamily[1] In this equivalence relation, objects are classified by the producer, the line in which the object was allocated. In zero-argument form, the equivalence relation creates a Kind matching objects whose producer is unknown. In one-argument form, the equivalence relation constructor creates an alternative equivalence relation and has two possible types of arguments: path_prefix: string+ A path prefix filter on the file name scope: Anything+ Anything that can be used by inspect.getsourcelines() In the two-argument form, the equivalence relation creates a Kind matching objects whose producer matches exactly the given arguments: filename: string+ File name of the producer lineno: positive+ Line number of producer With None arguments, the default equivalence relation will never match, but alternate equivalence relations may, as described in KindOfProdFamily[1]. References [0] heapy_Use.html#heapykinds.Use.Prod [1] heapy_UniSet.html#heapykinds.KindOfProdFamilyaRcs: EquivalenceRelation Rcs ( 0..*: alt:[kind: Kind+ or sok: SetOfKind+]) -> KindOfRetClaSetFamily (Referrer classification set.) In this equivalence relation, objects are classified by classifying their referrers, using the Clodo equivalence relation. These classifications are collected in a set, representing the classification of the object. Calling Rcs creates an equivalence class from specified set of referrer classifications. The arguments specify a set of Kind objects, each of which representing an equivalence class of Clodo. kind: Kind+ This adds a single Kind to the set of Kinds of referrers. sok: SetOfKind+ This adds each Kind in the sok argument to the total set of Kinds of referrers. References [0] heapy_Use.html#heapykinds.Use.Rcsa?Size: EquivalenceRelation Size(size: notnegative+) -> KindOfSizeFamily[1]) In this equivalence relation, objects are classified by memory size, so each equivalence class represents a particular size of object. References [0] heapy_Use.html#heapykinds.Use.Size [1] heapy_UniSet.html#heapykinds.KindOfSizeFamilyaType: EquivalenceRelation Type(type: type+) -> KindOfTypeFamily[1] In this equivalence relation, objects are classified by type so each equivalence class represents objects of a particular type. Calling it creates a Kind representing the type specified in the argument: type: type+ A Python type object or a representation of it. References [0] heapy_Use.html#heapykinds.Use.Type [1] heapy_UniSet.html#heapykinds.KindOfTypeFamilya?Unity: EquivalenceRelation Unity() -> Kind[1] In this equivalence relation, all objects are considered equivalent. There is only one equivalence class, that is, Anything[2]. References [0] heapy_Use.html#heapykinds.Use.Unity [1] heapy_UniSet.html#heapykinds.Kind [2] heapy_Use.html#heapykinds.Use.AnythingaVia: EquivalenceRelation Via( 0..*:rel: relationname+) -> KindOfInViaFamily[1] In this equivalence relation, objects are classified by how they are referred from their referrers, so each equivalence class represents objects that have a particular set of relations to their referrers. Calling it creates a Kind representing the set of referrers specified by the argument: rel: relationname+ Each argument specifies one referrer relation. The arguments should be strings and can be of any of the following forms. [expression] Indexing of a dict, list, tuple (etc). The expression must be a Python expression that can be evaluated in a local environment. The environment will contain the builtins and a name 'hp' that is bound to the current Use instance. .attribute Getting an attribute from a builtin type or a slot of a slotted type. (I.E. not an attribute that is in a dict of an object.) .f_locals["name"] A local variable of a frame. .f_locals ["name"] A variable in a CELL of a frame. Note the space between f_locals and [. This is to distinguish it from ordinary locals, and still use a syntax that could be used to access those variables directly from Python. .keys()[integer] A key in a dictionary, at the indicated place in its keys(). References [0] heapy_Use.html#heapykinds.Use.Via [1] heapy_UniSet.html#heapykinds.KindOfInViaFamilya~ findex( 0..*:kind: Kind+) -> ( Subkind of: EquivalenceRelation[1] callable: (index: notnegative+) Calling the returned equivalence relation creates an equivalence class. Argument index: notnegative+ The position of the matching kind in the sequence of kinds. The first one has index 0. Specifying the length of the sequence means that the equivalence class returned is the one where none of the kinds in the sequence matched. ) Create an equivalence relation based on a sequence of kinds. The name is a combination of find and index. The classification of each objects is done as follows: For each kind in the sequence, check whether the object is an element of that kind. If it is, the classification is the index of that kind in the sequence. If the end of the sequence is reached, the classification is the length of the sequence. Argument kind: Kind+ Each argument specifies the kind in that position in the sequence. Bugs Though the Kind objects representing the equivalence classes work with set operations such as intersection and union, the tests such as subset and equality do not generally give the expected result. References [0] heapy_Use.html#heapykinds.Use.findex [1] heapy_UniSet.html#heapykinds.EquivalenceRelationaqidset(nodes: iterable+) -> IdentitySet[1] Create a set of objects based on identity. Argument nodes: iterable+ The argument must be an iterable and may yield any kind of objects. Note This method is the same as iso except for the argument. References [0] heapy_Use.html#heapykinds.Use.idset [1] heapy_UniSet.html#heapykinds.IdentitySetauiso( 0..*:node: Any+) -> IdentitySet[1] Create a set of objects based on identity. Argument node: Any+ Any kind of objects are valid arguments. Note This method is the same as idset[2] except for the argument. References [0] heapy_Use.html#heapykinds.Use.iso [1] heapy_UniSet.html#heapykinds.IdentitySet [2] heapy_Use.html#heapykinds.Use.idset )rX)ro)rorro)r)NNr6)Nro)F)/__name__ __module__ __qualname__ _preload_ _chgable__dir_ _private_rr;r?rArCrOrSrWrarer'r*rrr rr+r)r#r,r-r.r$ _imports_ _doc_Anything _doc_Clodo_doc_Id _doc_Idset _doc_Module _doc_Nothing _doc_Prod_doc_Rcs _doc_Size _doc_Type _doc_Unity_doc_Via _doc_findex _doc_idset_doc_iso _doc_sokindrr=r:rrs.I?I EI  % % % * * */// 8888,GGG:JJJ$$$$L,c!c!c!c!J000 )))....0!!!! """""""" 4 4 4 4IB2M/J0 ,G  J0K"1L"9IH-H, 9I 9I 2J%:HN#rsVn n n n n %).*n n n n n r=