ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //usr/lib64/python3.8/__pycache__/pprint.cpython-38.pyc
U

e5dS
@sdZddlZddlZddlZddlZddlm	Z
dddddd	d
gZd%d
ddddZd&d
ddddZ
d
ddd
ZddZddZddZGdddZddZGdd	d	ZddZeeeeeeeeedhZddZ d'd d!Z!d"d#Z"e#d$kre!dS)(a/Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

N)StringIOpprintpformat
isreadableisrecursivesaferepr
PrettyPrinterppPFTcompact
sort_dictscCs"t||||||d}||dS)zAPretty-print a Python object to a stream [default is sys.stdout].)streamindentwidthdepthr
rN)rr)objectrrrrr
rZprinterr/usr/lib64/python3.8/pprint.pyr/scCst|||||d|S)z<Format a Python object into a pretty-printed representation.)rrrr
r)rr)rrrrr
rrrrr7s)rcOst|f|d|i|dS)zPretty-print a Python objectrN)r)rrargskwargsrrrr	=scCst|iddddS)z=Version of repr() which can handle recursive data structures.NrT
_safe_reprrrrrrAscCst|iddddS)z4Determine if saferepr(object) is readable by eval().NrTr
rrrrrrEscCst|iddddS)z8Determine if object requires a recursive representation.NrTrrrrrrIsc@s&eZdZdZdgZddZddZdS)	_safe_keyaUHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    objcCs
||_dSN)r)selfrrrr__init__Ysz_safe_key.__init__cCsXz|j|jkWStk
rRtt|jt|jftt|jt|jfkYSXdSr)r	TypeErrorstrtypeid)rotherrrr__lt__\sz_safe_key.__lt__N)__name__
__module____qualname____doc__	__slots__r r&rrrrrMs	rcCst|dt|dfS)z&Helper function for comparing 2-tuplesrr
)r)trrr_safe_tuplecsr-c@seZdZd;dddddZd	d
ZddZd
dZddZddZiZ	ddZ
e
e	ej<ddZ
e
e	ejj<ddZee	ej<ddZee	ej<ddZee	ej<ee	ej<ddZee	ej<dd Zee	ej<d!d"Zee	ej<d#d$Zee	ejj<d%d&Z d'd(Z!d)d*Z"d+d,Z#d-d.Z$e$e	ej%j<d/d0Z&e&e	ej'j<d1d2Z(e(e	ej)j<d3d4Z*e*e	ej+j<d5d6Z,e,e	ej-j<d7d8Z.e.e	ej/j<d9d:Z0e0e	ej1j<dS)<rr
rNFTrcCst|}t|}|dkr td|dk	r8|dkr8td|sDtd||_||_||_|dk	rf||_ntj|_t||_	||_
dS)aHandle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0)int
ValueError_depth_indent_per_level_width_stream_sysstdoutbool_compact_sort_dicts)rrrrrr
rrrrr hs 
zPrettyPrinter.__init__cCs&|||jddid|jddS)Nr
)_formatr3writerrrrrrszPrettyPrinter.pprintcCs"t}|||ddid|SNr)	_StringIOr:getvalue)rrZsiorrrrszPrettyPrinter.pformatcCs||idddS)Nrrformatr<rrrrszPrettyPrinter.isrecursivecCs ||idd\}}}|o|Sr=r@)rrsreadable	recursiverrrrszPrettyPrinter.isreadablec	Cst|}||kr.|t|d|_d|_dS||||}|j||}	t||	kr|j	t
|jd}
|
dk	rd||<|
|||||||d||=dSt|t
rd||<|||||||d||=dS||dS)NTFr
)r$r;
_recursion
_recursive	_readable_reprr2len	_dispatchgetr#__repr__
isinstancedict_pprint_dict)rrrr	allowancecontextlevelobjidrep	max_widthprrrr:s0
zPrettyPrinter._formatc
Csz|j}|d|jdkr*||jddt|}|rn|jrNt|td}	n|}	||	|||d|||ddS)N{r
 key})r;r1rIr8sorteditemsr-_format_dict_items)
rrrrrPrQrRr;Zlengthr]rrrrOs
zPrettyPrinter._pprint_dictcCslt|s|t|dS|j}||jd|t|||t|jd|d|||ddS)N(r
))rIr;repr	__class__r'r:listr])rrrrrPrQrRclsrrr_pprint_ordered_dictsz"PrettyPrinter._pprint_ordered_dictcCs0|d|||||d|||ddS)N[r
])r;
_format_itemsrrrrrPrQrRrrr_pprint_lists
zPrettyPrinter._pprint_listcCsH|dt|dkrdnd}|||||t|||||dS)Nr_r
z,)r`)r;rIrh)rrrrrPrQrRendcharrrr
_pprint_tuples
zPrettyPrinter._pprint_tuplec	Cst|s|t|dS|j}|tkr8|dd}n&||jdd}|t|jd7}t|td}|||||t|||||dS)NrWr[({})r
rY)	rIr;rarbsetr'r\rrh)	rrrrrPrQrRtyprkrrr_pprint_sets 
zPrettyPrinter._pprint_setcCs|j}t|s|t|dSg}|d}	|dkrD|d7}|d7}|j|}
}t|	D]\}}
t|
}|t|	dkr|
|8}
t||
kr||qZtd|
}|st	|drt	|
|}d}t|D]l\}}||}|t|dkr|t|	dkr||8}tt||kr:|r4|t||}q|}q|rZ|t|qZt|dkrn||dS|dkr|dt|D],\}}|dkr|dd	|||q|dkr|d
dS)NTr
z\S*\s*r_rr9rXr`)r;rIra
splitlinesr2	enumerateappendrefindallAssertionErrorpop)rrrrrPrQrRr;ZchunkslinesZ
max_width1rUilinerTpartsZ
max_width2currentjpart	candidaterrr_pprint_strsX
$


zPrettyPrinter._pprint_strcCs|j}t|dkr"|t|dS|dk}|rF|d7}|d7}|dd}	t||j||D]$}
||	||
|	s\dd|}	q\|r|ddS)Nr
r_rsr9rXr`)r;rIra_wrap_bytes_reprr2)rrrrrPrQrRr;ZparensdelimrTrrr
_pprint_bytes3s"zPrettyPrinter._pprint_bytesc	Cs>|j}|d|t|||d|d||d|ddS)Nz
bytearray(
r
r`)r;rbytes)rrrrrPrQrRr;rrr_pprint_bytearrayHszPrettyPrinter._pprint_bytearraycCs8|d||||d|d|||ddS)Nz
mappingproxy(
r
r`)r;r:copyrirrr_pprint_mappingproxyQs
z"PrettyPrinter._pprint_mappingproxyc	Cs|j}||j7}dd|}t|d}	t|D]f\}
\}}|
|	k}
||||}|||d||||t|d|
r|nd|||
s0||q0dS)N,
rXr
z: r)r;r1rIrurHr:)rr]rrrPrQrRr;delimnlZ
last_indexr|rZentlastrTrrrr^Ys 

z PrettyPrinter._format_dict_itemscCsL|j}||j7}|jdkr,||jdddd|}d}	|j|d}
}t|}zt|}
Wntk
rxYdSXd}|sH|
}zt|}
Wn(tk
rd}||8}|
|8}
YnX|jr||||}t|d}|
|kr|}
|	r|}	|
|kr|
|8}
||	d}	||q~||	|}	|	||||r<|nd||q~dS)	Nr
rXrrsFTr, )
r;r1r2iternext
StopIterationr7rHrIr:)rr]rrrPrQrRr;rrrrUitZnext_entrrrTwrrrrhjsR



zPrettyPrinter._format_itemscCs4||||j|\}}}|s&d|_|r0d|_|S)NFT)rArr0rGrF)rrrQrRrarCrDrrrrHs
zPrettyPrinter._reprcCst|||||jS)zFormat object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        )rr8)rrrQ	maxlevelsrRrrrrAszPrettyPrinter.formatc	Cst|s|t|dS||j||}|j}|t|jd7}|d|j|d|f|||||d|||ddS)Nr
z	%s(%s,
%srXr`)rIr;rarHdefault_factoryrbr'rO)	rrrrrPrQrRZrdfrdrrr_pprint_default_dictsz"PrettyPrinter._pprint_default_dictc	Cst|s|t|dS|j}||jd|jdkrN||jdd|}||||t|jd|d|||ddS)Nrmr
rXrrn)rIr;rarbr'r1most_commonr^)	rrrrrPrQrRrdr]rrr_pprint_counters
zPrettyPrinter._pprint_counterc
	Cst|js|t|dS|j}||jd|t|jd7}t|jD]d\}}	|t|jdkr||	|||d|||dqN||	||d|||dd|qNdS)Nr_r
r`rrX)rImapsr;rarbr'rur:)
rrrrrPrQrRrdr|mrrr_pprint_chain_maps
zPrettyPrinter._pprint_chain_mapc	Cst|s|t|dS|j}||jd|t|jd7}|d|jdkrz|||||d|||dn:||||d||||j||}|dd||fdS)Nr_r
rfrz])z],
%smaxlen=%s)rX)rIr;rarbr'maxlenrhrH)	rrrrrPrQrRrdZrmlrrr
_pprint_deques&

zPrettyPrinter._pprint_dequec	Cs||j|||||ddSNr
r:datarirrr_pprint_user_dictszPrettyPrinter._pprint_user_dictc	Cs||j|||||ddSrrrirrr_pprint_user_listszPrettyPrinter._pprint_user_listc	Cs||j|||||ddSrrrirrr_pprint_user_stringsz!PrettyPrinter._pprint_user_string)r
rNN)2r'r(r)r rrrrr:rJrOrNrLre_collectionsOrderedDictrjrcrltuplerqro	frozensetrr"rrr	bytearrayr_typesMappingProxyTyper^rhrHrArdefaultdictrCounterrChainMaprdequerUserDictrUserListr
UserStringrrrrrgs^+




1


)	cCst|}|tkrt|ddfSt|dd}t|trD|tjkrD|sJdSt|}|rl||krldd||kfS||krt|ddfSd||<d}d}	g}
|
j	}|d7}|rt
|td}n|}|D]b\}
}t
|
||||\}}}t
|||||\}}}|d||f|o|o|}|s$|rd}	q||=d	d
|
||	fSt|tr\|tjkstt|trn|tjkrnt|tr|sdSd}n"t|dkrd
}n|sdSd}t|}|r||kr|dd||kfS||krt|ddfSd||<d}d}	g}
|
j	}|d7}|D]8}t
|||||\}}}|||sFd}|rd}	q||=|d
|
||	fSt|}||o|ddfS)NTFrL)z{}TFz{...}r
rYz%s: %sz{%s}r)z[]TFz[%s]z(%s,))z()TFz(%s)z...<)r#_builtin_scalarsragetattr
issubclassrNrLr$rErvr\r]r-rjoinrcrrI
startswith)rrQrrRrrprrSrCrDZ
componentsrvr]kvZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurrAoZoreprZ	oreadableZorecurrTrrrrs

rcCsdt|jt|fS)Nz<Recursion on %s with id=%s>)r#r'r$rrrrrE?srEcCsddl}|dkr,ddddgdddfgd	}t}|}t|iddd
|}|||}td||td||dS)
Nrstring)r
rr)iTz_safe_repr:zpformat:)timerperf_counterrrprint)rrrVt1t2Zt3rrr
_perfcheckDs
rccsd}t|dd}tdt|dD]T}|||d}||}||krP||8}tt||krt|rnt|V|}q$|}q$|rt|VdS)Nrr)rIrangera)rrrPrrr|rrrrrrQs
r__main__)Nr
rN)r
rN)N)$r*collectionsrrwsysr4typesriorr>__all__rrr	rrrrr-rrrr"rrr.floatcomplexr6r#rrErrr'rrrr<module>sJ
F